mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
parent
5d61cbf4a8
commit
daba47790c
9 changed files with 125 additions and 125 deletions
|
@ -6,22 +6,18 @@ module Whois
|
|||
Setting.registry_whois_disclaimer
|
||||
end
|
||||
|
||||
def self.refresh(domain_name)
|
||||
if domain_name.at_auction?
|
||||
# Remove original record since `Domain#update_whois_record` callback is disabled when
|
||||
# domain is at auction
|
||||
find_by(name: domain_name.to_s).try(:destroy!)
|
||||
|
||||
create!(name: domain_name, json: { name: domain_name.to_s,
|
||||
status: ['AtAuction'],
|
||||
disclaimer: disclaimer })
|
||||
elsif domain_name.awaiting_payment? || domain_name.pending_registration?
|
||||
find_by(name: domain_name.to_s).update!(json: { name: domain_name.to_s,
|
||||
status: ['PendingRegistration'],
|
||||
disclaimer: disclaimer })
|
||||
else
|
||||
find_by(name: domain_name.to_s).destroy!
|
||||
def update_from_auction(auction)
|
||||
if auction.started?
|
||||
update!(json: { name: auction.domain,
|
||||
status: ['AtAuction'],
|
||||
disclaimer: self.class.disclaimer })
|
||||
elsif auction.no_bids?
|
||||
destroy!
|
||||
elsif auction.awaiting_payment? || auction.payment_received?
|
||||
update!(json: { name: auction.domain,
|
||||
status: ['PendingRegistration'],
|
||||
disclaimer: self.class.disclaimer })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue