Merge branch 'master' into credit-and-debit-card-payments

This commit is contained in:
Maciej Szlosarczyk 2018-04-30 11:38:19 +03:00
commit d7afb3880a
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
16 changed files with 245 additions and 62 deletions

View file

@ -23,6 +23,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)'
}
@ -88,7 +94,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