Fix rubocop errors

This commit is contained in:
J Guthrie 2018-11-04 18:52:45 +00:00
parent c2f23fea6a
commit 3b68061e87
4 changed files with 8 additions and 16 deletions

View file

@ -1,7 +1,5 @@
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
record.errors[attribute] << (options[:message] || I18n.t("validations.trailing whitespace")) if value =~ /\s\z/
end
end
end