Attach nameservers to domain

This commit is contained in:
Martin Lensment 2014-08-01 17:52:35 +03:00
parent f6ce3b4c4e
commit d01944fe21
5 changed files with 22 additions and 3 deletions

View file

@ -3,7 +3,7 @@ module Epp::DomainsHelper
@domain = Domain.new(domain_create_params)
Domain.transaction do
if @domain.save && @domain.attach_contacts(domain_contacts)
if @domain.save && @domain.attach_contacts(domain_contacts) && @domain.attach_nameservers(domain_nameservers)
render '/epp/domains/create'
else
handle_errors
@ -50,6 +50,11 @@ module Epp::DomainsHelper
res
end
def domain_nameservers
ph = params_hash['epp']['command']['create']['create']['ns']
ph[:hostObj]
end
def handle_errors
super({
'2302' => [:epp_domain_taken, :epp_domain_reserved],