Class: ActiveModel::Validations::AbsenceValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::AbsenceValidator
- Defined in:
- lib/active_model/validations/absence_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 |
# File 'lib/active_model/validations/absence_validator.rb', line 4 def validate_each(record, attribute, value) record.errors.add(attribute, [:message] || :absence) unless value.blank? end |