mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 22:24:47 +02:00
parent
f7c2b25a66
commit
ce3b04bff0
2 changed files with 16 additions and 1 deletions
|
@ -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
|
||||
|
|
8
app/views/for_models/whois_discarded.erb
Normal file
8
app/views/for_models/whois_discarded.erb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue