Merge branch 'master' into 115693873-whodunnit_empty

This commit is contained in:
Stas Paaslane 2016-08-12 16:56:40 +03:00
commit e23b5fc9cf
125 changed files with 2167 additions and 714 deletions

View file

@ -8,8 +8,13 @@ class DomainUpdateConfirmJob < Que::Job
case action
when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
raise_errors!(domain)
domain.apply_pending_update!
raise_errors!(domain)
domain.clean_pendings!
raise_errors!(domain)
when RegistrantVerification::REJECTED
domain.send_mail :pending_update_rejected_notification_for_new_registrant
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
@ -18,4 +23,8 @@ class DomainUpdateConfirmJob < Que::Job
destroy # it's best to destroy the job in the same transaction
end
end
def raise_errors!(domain)
throw "domain #{domain.name} failed with errors #{domain.errors.full_messages}" if domain.errors.any?
end
end