Move ns and status validation to separate methods

This commit is contained in:
Martin Lensment 2014-09-10 13:34:47 +03:00
parent df5da8dc4b
commit 7b88e6e028
2 changed files with 36 additions and 13 deletions

View file

@ -4,7 +4,12 @@ module Epp::DomainsHelper
@domain = Domain.new(domain_create_params)
@domain.attach_owner_contact(@ph[:registrant]) if @ph[:registrant]
@domain.save
unless @domain.save
handle_errors(@domain)
raise ActiveRecord::Rollback and return
end
@domain.parse_and_attach_domain_dependencies(parsed_frame)
@domain.all_dependencies_valid?