X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c2f23fea6a7821a4ad4c97fd65744b138ec86267..3b68061e8760448a80cd501e429b9901944fdf1d:/app/validators/trailing_whitespace_validator.rb diff --git a/app/validators/trailing_whitespace_validator.rb b/app/validators/trailing_whitespace_validator.rb index bb34ef463..03d6ef4db 100644 --- a/app/validators/trailing_whitespace_validator.rb +++ b/app/validators/trailing_whitespace_validator.rb @@ -1,7 +1,5 @@ class TrailingWhitespaceValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) - if value =~ /\s\z/ - record.errors[attribute] << (options[:message] || I18n.t("validations.trailing whitespace")) - end + record.errors[attribute] << (options[:message] || I18n.t("validations.trailing whitespace")) if value =~ /\s\z/ end -end \ No newline at end of file +end