Change blocked domain error message #2564

This commit is contained in:
Martin Lensment 2015-07-28 14:06:50 +03:00
parent 0ea07de2d1
commit a70273a3b9
4 changed files with 8 additions and 5 deletions

View file

@ -3,7 +3,7 @@ class DomainNameValidator < ActiveModel::EachValidator
if !self.class.validate_format(value)
record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid))
elsif !self.class.validate_blocked(value)
record.errors.add(attribute, (options[:message] || record.errors.generate_message(attribute, :blocked)))
record.errors.add(:base, :domain_name_blocked)
end
end