]> git.openstreetmap.org Git - rails.git/blobdiff - app/validators/leading_whitespace_validator.rb
Converted invalid_chars validator to use locale
[rails.git] / app / validators / leading_whitespace_validator.rb
index e33d3c01b1624ba1cef6be2c7cf613ceae7e565e..90e7d9c95bf9f0854c25f02e6c30df2e59e1a7db 100644 (file)
@@ -1,5 +1,5 @@
 class LeadingWhitespaceValidator < ActiveModel::EachValidator
   def validate_each(record, attribute, value)
-    record.errors[attribute] << (options[:message] || I18n.t("validations.leading whitespace")) if value =~ /\A\s/
+    record.errors[attribute] << (options[:message] || I18n.t("validations.leading_whitespace")) if value =~ /\A\s/
   end
 end