mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +02:00
whois update in auction list
This commit is contained in:
parent
316f00cadc
commit
06254fb994
3 changed files with 19 additions and 5 deletions
|
@ -1,4 +1,7 @@
|
|||
class Auction < ApplicationRecord
|
||||
after_create :whois_create
|
||||
after_destroy :whois_destroy
|
||||
|
||||
enum status: {
|
||||
started: 'started',
|
||||
awaiting_payment: 'awaiting_payment',
|
||||
|
@ -116,6 +119,17 @@ class Auction < ApplicationRecord
|
|||
new_auction.start
|
||||
end
|
||||
|
||||
def whois_create
|
||||
Whois::Record.transaction do
|
||||
whois_record = Whois::Record.find_or_create_by!(name: domain)
|
||||
whois_record.update_from_auction(self)
|
||||
end
|
||||
end
|
||||
|
||||
def whois_destroy
|
||||
Whois::Record.find_by(name: domain)&.destroy!
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_registration_code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue