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