Converted invalid_chars validator to use locale
This commit is contained in:
parent
3b68061e87
commit
e091246ffc
5 changed files with 8 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue