Class: ActiveModel::Validations::VerityValidator

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

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



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

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