mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
27 lines
1,020 B
Ruby
27 lines
1,020 B
Ruby
module Whois
|
|
class Record < Whois::Server
|
|
self.table_name = 'whois_records'
|
|
|
|
def self.disclaimer
|
|
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!
|
|
end
|
|
end
|
|
end
|
|
end
|