mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 22:16:19 +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
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,3 +15,5 @@
|
||||||
/config/master.key
|
/config/master.key
|
||||||
# Do not commit one. Instead, download the latest from https://github.com/internetee/style-guide.
|
# Do not commit one. Instead, download the latest from https://github.com/internetee/style-guide.
|
||||||
.rubocop.yml
|
.rubocop.yml
|
||||||
|
/lib/tasks/mock.rake
|
||||||
|
|
||||||
|
|
|
@ -64,13 +64,11 @@ module Admin
|
||||||
|
|
||||||
response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])
|
response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])
|
||||||
|
|
||||||
if response.code == "200"
|
if response.code == '200'
|
||||||
return record_result_for_each_api_user(response: response)
|
record_result_for_each_api_user(response: response)
|
||||||
else
|
else
|
||||||
return redirect_to request.referer, notice: 'Registrar no found'
|
redirect_to request.referer, notice: 'Registrar no found'
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to request.referer, notice: 'Something goes wrong'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_test_date
|
def remove_test_date
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
class Auction < ApplicationRecord
|
class Auction < ApplicationRecord
|
||||||
|
after_create :whois_create
|
||||||
|
after_destroy :whois_destroy
|
||||||
|
|
||||||
enum status: {
|
enum status: {
|
||||||
started: 'started',
|
started: 'started',
|
||||||
awaiting_payment: 'awaiting_payment',
|
awaiting_payment: 'awaiting_payment',
|
||||||
|
@ -116,6 +119,17 @@ class Auction < ApplicationRecord
|
||||||
new_auction.start
|
new_auction.start
|
||||||
end
|
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
|
private
|
||||||
|
|
||||||
def generate_registration_code
|
def generate_registration_code
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue