mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Error handling
This commit is contained in:
parent
2adbd915f7
commit
d81c97052d
7 changed files with 51 additions and 41 deletions
|
@ -10,7 +10,7 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
if !self.class.validate_format(value)
|
||||
record.errors[attribute] << (options[:message] || 'invalid format')
|
||||
elsif !self.class.validate_reservation(value)
|
||||
record.errors[attribute] << (options[:message] || I18n.t('errors.messages.epp_domain_reserved'))
|
||||
record.errors.add(attribute, (options[:message] || :reserved))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue