mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Merge branch 'master' of github.com:internetee/registry
This commit is contained in:
commit
0f3f251df1
5 changed files with 48 additions and 18 deletions
|
@ -35,16 +35,28 @@ module Epp::DomainsHelper
|
|||
end
|
||||
|
||||
def update_domain
|
||||
@domain = find_domain
|
||||
Domain.transaction do
|
||||
@domain = find_domain
|
||||
|
||||
handle_errors(@domain) and return unless @domain
|
||||
handle_errors(@domain) and return unless @domain.parse_and_attach_domain_dependencies(@ph, parsed_frame.css('add'))
|
||||
handle_errors(@domain) and return unless @domain.parse_and_detach_domain_dependencies(parsed_frame.css('rem'))
|
||||
handle_errors(@domain) and return unless @domain.parse_and_update_domain_dependencies(parsed_frame.css('chg'))
|
||||
handle_errors(@domain) and return unless @domain.parse_and_update_domain_attributes(parsed_frame.css('chg'))
|
||||
handle_errors(@domain) and return unless @domain.save
|
||||
handle_errors(@domain) and return unless @domain
|
||||
|
||||
render '/epp/domains/success'
|
||||
@domain.parse_and_attach_domain_dependencies(@ph, parsed_frame.css('add'))
|
||||
@domain.parse_and_detach_domain_dependencies(parsed_frame.css('rem'))
|
||||
@domain.parse_and_update_domain_dependencies(parsed_frame.css('chg'))
|
||||
@domain.parse_and_update_domain_attributes(parsed_frame.css('chg'))
|
||||
|
||||
if @domain.errors.any?
|
||||
handle_errors(@domain)
|
||||
raise ActiveRecord::Rollback and return
|
||||
end
|
||||
|
||||
unless @domain.save
|
||||
handle_errors(@domain)
|
||||
raise ActiveRecord::Rollback and return
|
||||
end
|
||||
|
||||
render '/epp/domains/success'
|
||||
end
|
||||
end
|
||||
|
||||
### HELPER METHODS ###
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue