mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
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:
commit
eba3facc58
3 changed files with 4 additions and 5 deletions
|
@ -27,13 +27,13 @@ module Whois
|
||||||
when 'reserved' then ReservedDomain
|
when 'reserved' then ReservedDomain
|
||||||
when 'blocked' then BlockedDomain
|
when 'blocked' then BlockedDomain
|
||||||
when 'domain' then Domain
|
when 'domain' then Domain
|
||||||
when 'disputed' then Dispute.active
|
when 'disputed' then Dispute
|
||||||
else DNS::Zone
|
else DNS::Zone
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_record(collection, name)
|
def find_record(collection, name)
|
||||||
if collection == Dispute.active
|
if collection == Dispute
|
||||||
collection.find_by(domain_name: name)
|
collection.find_by(domain_name: name)
|
||||||
else
|
else
|
||||||
collection == DNS::Zone ? collection.find_by(origin: name) : collection.find_by(name: name)
|
collection == DNS::Zone ? collection.find_by(origin: name) : collection.find_by(name: name)
|
||||||
|
|
|
@ -37,8 +37,7 @@ namespace :whois do
|
||||||
end
|
end
|
||||||
|
|
||||||
print "\n-----> Update disputed domains whois_records"
|
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'
|
UpdateWhoisRecordJob.perform_later group.map(&:domain_name), 'disputed'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ class SendEInvoiceJobTest < ActiveJob::TestCase
|
||||||
domain_names = ReservedDomain.find_in_batches.first.map(&:name)
|
domain_names = ReservedDomain.find_in_batches.first.map(&:name)
|
||||||
assert_domains_processed_by_task(domain_names, 'reserved')
|
assert_domains_processed_by_task(domain_names, 'reserved')
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def assert_domains_processed_by_task(domain_names, type)
|
def assert_domains_processed_by_task(domain_names, type)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue