Class: ActiveModel::Validations::VerityValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::VerityValidator
- 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 => [:message], :value => value) unless value.is_a?(TrueClass) end |