Converted invalid_chars validator to use locale

This commit is contained in:
J Guthrie 2018-11-05 01:55:25 +00:00
parent 3b68061e87
commit e091246ffc
5 changed files with 8 additions and 7 deletions

View file

@ -1,5 +1,5 @@
class TrailingWhitespaceValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors[attribute] << (options[:message] || I18n.t("validations.trailing whitespace")) if value =~ /\s\z/
record.errors[attribute] << (options[:message] || I18n.t("validations.trailing_whitespace")) if value =~ /\s\z/
end
end