Do not show discarded domain details in WHOIS

#789
This commit is contained in:
Artur Beljajev 2018-04-09 00:42:22 +03:00
parent f7c2b25a66
commit ce3b04bff0
2 changed files with 16 additions and 1 deletions

View file

@ -37,6 +37,12 @@ class WhoisRecord < ActiveRecord::Base
h = HashWithIndifferentAccess.new
return h if domain.blank?
if domain.discarded?
h[:name] = domain.name
h[:status] = ['deleteCandidate']
return h
end
status_map = {
'ok' => 'ok (paid and in zone)'
}
@ -102,7 +108,8 @@ class WhoisRecord < ActiveRecord::Base
end
def generated_body
template = Rails.root.join("app/views/for_models/whois.erb".freeze)
template_name = domain.discarded? ? 'whois_discarded.erb' : 'whois.erb'
template = Rails.root.join("app/views/for_models/#{template_name}".freeze)
ERB.new(template.read, nil, "-").result(binding)
end
# rubocop:enable Metrics/MethodLength

View file

@ -0,0 +1,8 @@
Estonia .ee Top Level Domain WHOIS server
Domain:
name: <%= json['name'] %>
status: <%= json['status'] %>
Estonia .ee Top Level Domain WHOIS server
More information at http://internet.ee