]> git.openstreetmap.org Git - rails.git/blobdiff - app/validators/trailing_whitespace_validator.rb
Merge leading and trailing whitespace validators
[rails.git] / app / validators / trailing_whitespace_validator.rb
diff --git a/app/validators/trailing_whitespace_validator.rb b/app/validators/trailing_whitespace_validator.rb
deleted file mode 100644 (file)
index bb34ef4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-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
-  end
-end
\ No newline at end of file