mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Remove redundant functionality
This commit is contained in:
parent
4efd94a90b
commit
0b2b1b0ef1
4 changed files with 26 additions and 32 deletions
|
@ -1,4 +1,5 @@
|
|||
class Dispute < ApplicationRecord
|
||||
include WhoisStatusPopulate
|
||||
validates :domain_name, :password, :starts_at, :expires_at, presence: true
|
||||
before_validation :fill_empty_passwords, :set_expiry_date
|
||||
validate :validate_domain_name_format
|
||||
|
@ -48,7 +49,7 @@ class Dispute < ApplicationRecord
|
|||
return if domain
|
||||
|
||||
wr = Whois::Record.find_or_initialize_by(name: domain_name)
|
||||
wr.json = @json = generate_json(wr)
|
||||
wr.json = @json = generate_json(wr, domain_status: 'disputed')
|
||||
wr.save
|
||||
end
|
||||
|
||||
|
@ -79,18 +80,6 @@ class Dispute < ApplicationRecord
|
|||
record.save
|
||||
end
|
||||
|
||||
def generate_json(record)
|
||||
h = HashWithIndifferentAccess.new(name: domain_name, status: ['disputed'])
|
||||
return h if record.json.blank?
|
||||
|
||||
status_arr = (record.json['status'] ||= [])
|
||||
return record.json if status_arr.include? 'disputed'
|
||||
|
||||
status_arr.push('disputed')
|
||||
record.json['status'] = status_arr
|
||||
record.json
|
||||
end
|
||||
|
||||
def remove_data
|
||||
UpdateWhoisRecordJob.enqueue domain_name, 'disputed'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue