Class: ActiveModel::Validations::FalsityValidator

Inherits:
EachValidator
  • Object
show all
Defined in:
lib/validates_truthiness/validates_falsity.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



4
5
6
# File 'lib/validates_truthiness/validates_falsity.rb', line 4

def validate_each(record, attribute, value)
  record.errors.add(attribute, :falsity,     :message => options[:message], :value => value) unless value.is_a?(FalseClass)
end