Add disclaimer to whois JSON

This commit is contained in:
Maciej Szlosarczyk 2018-04-25 15:28:56 +03:00
parent 764414ba34
commit 9c606bdf2f
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
3 changed files with 42 additions and 1 deletions

View file

@ -51,4 +51,4 @@ class UpdateWhoisRecordJob < Que::Job
def delete_blocked(name)
delete_reserved(name)
end
end
end

View file

@ -36,6 +36,7 @@ class WhoisRecord < ActiveRecord::Base
registrant = domain.registrant
@disclosed = []
h[:disclaimer] = disclaimer_text
h[:name] = domain.name
h[:status] = domain.statuses.map { |x| status_map[x] || x }
h[:registered] = domain.registered_at.try(:to_s, :iso8601)
@ -120,4 +121,10 @@ class WhoisRecord < ActiveRecord::Base
def destroy_whois_record
Whois::Record.where(name: name).delete_all
end
private
def disclaimer_text
Setting.registry_whois_disclaimer
end
end