Use translation file for errors, display reserved domain error through epp

This commit is contained in:
Martin Lensment 2014-07-30 12:31:36 +03:00
parent e3c60d51fe
commit d96b1b5deb
6 changed files with 40 additions and 2 deletions

View file

@ -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] || 'Domain name is reserved or restricted')
record.errors[attribute] << (options[:message] || I18n.t('errors.messages.epp_domain_reserved'))
end
end