Revamp WHOIS for auctions

Fixes #1105
This commit is contained in:
Artur Beljajev 2019-03-17 19:24:44 +02:00
parent 5d61cbf4a8
commit daba47790c
9 changed files with 125 additions and 125 deletions

View file

@ -33,8 +33,10 @@ module DNS
end
def sell_at_auction
Auction.sell(self)
update_whois
auction = Auction.new
auction.domain = name
auction.start
update_whois_from_auction(auction)
end
def at_auction?
@ -49,10 +51,6 @@ module DNS
pending_auction&.payment_received?
end
def update_whois
Whois::Record.refresh(self)
end
def registered?
Domain.find_by_idn(name)
end
@ -92,5 +90,10 @@ module DNS
def pending_auction
Auction.pending(self)
end
def update_whois_from_auction(auction)
whois_record = Whois::Record.find_by!(name: name)
whois_record.update_from_auction(auction)
end
end
end