]> git.openstreetmap.org Git - rails.git/blobdiff - app/validators/leading_whitespace_validator.rb
Fix rubocop errors
[rails.git] / app / validators / leading_whitespace_validator.rb
index fcefb0a196eeccc05a16a85a0659b7df9970bcda..e33d3c01b1624ba1cef6be2c7cf613ceae7e565e 100644 (file)
@@ -1,7 +1,5 @@
 class LeadingWhitespaceValidator < ActiveModel::EachValidator
   def validate_each(record, attribute, value)
 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
-end
\ No newline at end of file
+end