]> git.openstreetmap.org Git - rails.git/blobdiff - app/validators/invalid_url_chars_validator.rb
Converted invalid_chars validator to use locale
[rails.git] / app / validators / invalid_url_chars_validator.rb
index 38c4006b72701b25be12a64371f79cff3d818836..a93f6c6d9817aec8deb0dd5d980f6169601bf57e 100644 (file)
@@ -2,6 +2,6 @@ class InvalidUrlCharsValidator < ActiveModel::EachValidator
   INVALID_URL_CHARS = "/;.,?%#".freeze
 
   def validate_each(record, attribute, value)
   INVALID_URL_CHARS = "/;.,?%#".freeze
 
   def validate_each(record, attribute, value)
-    record.errors[attribute] << (options[:message] || I18n.t("validations.invalid chars", :invalid_chars => INVALID_URL_CHARS)) if value =~ /[#{INVALID_URL_CHARS}]/
+    record.errors[attribute] << (options[:message] || I18n.t("validations.invalid_url_chars", :invalid_url_chars => INVALID_URL_CHARS)) if value =~ /[#{INVALID_URL_CHARS}]/
   end
 end
   end
 end