Merge pull request #2193 from internetee/2191-disputed-domains-are-missing-from-whois

remove active disputed domains from retruned method
This commit is contained in:
Timo Võhmar 2021-10-22 10:50:13 +03:00 committed by GitHub
commit eba3facc58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View file

@ -27,13 +27,13 @@ module Whois
when 'reserved' then ReservedDomain
when 'blocked' then BlockedDomain
when 'domain' then Domain
when 'disputed' then Dispute.active
when 'disputed' then Dispute
else DNS::Zone
end
end
def find_record(collection, name)
if collection == Dispute.active
if collection == Dispute
collection.find_by(domain_name: name)
else
collection == DNS::Zone ? collection.find_by(origin: name) : collection.find_by(name: name)

View file

@ -37,8 +37,7 @@ namespace :whois do
end
print "\n-----> Update disputed domains whois_records"
Dispute.active.find_in_batches.each do |group|
Dispute.find_in_batches.each do |group|
UpdateWhoisRecordJob.perform_later group.map(&:domain_name), 'disputed'
end
end

View file

@ -16,7 +16,7 @@ class SendEInvoiceJobTest < ActiveJob::TestCase
domain_names = ReservedDomain.find_in_batches.first.map(&:name)
assert_domains_processed_by_task(domain_names, 'reserved')
end
private
def assert_domains_processed_by_task(domain_names, type)