Apply manual rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 11:07:11 +02:00
parent 6cbecb5b39
commit da0a682ffb
109 changed files with 431 additions and 416 deletions

View File

@ -3,10 +3,12 @@
module ActiveModel
module Validations
class BooleanPresenceValidator < EachValidator
BOOLEAN_VALUES = [false, true].freeze
def validate(record)
[attributes].flatten.each do |attribute|
value = record.send(:read_attribute_for_validation, attribute)
record.errors.add(attribute, nil, options) unless [false, true].include?(value)
record.errors.add(attribute, nil, options) unless BOOLEAN_VALUES.include?(value)
end
end
end