Better contact validation

This commit is contained in:
Martin Lensment 2014-07-31 14:04:22 +03:00
parent c78e40a65a
commit 5003a3ff20
5 changed files with 53 additions and 5 deletions

View file

@ -7,7 +7,9 @@ module Epp::DomainsHelper
render '/epp/domains/create'
else
handle_domain_name_errors
handle_contact_errors
render '/epp/error'
raise ActiveRecord::Rollback
end
end
end
@ -56,4 +58,10 @@ module Epp::DomainsHelper
end
end
def handle_contact_errors
if @domain.errors.added?(:admin_contacts, :blank)
epp_errors << {code: '2306', msg: @domain.errors[:admin_contacts].first}
end
end
end