Class: ActiveModel::Validations::AbsenceValidator
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveModel::EachValidator
|
Defined in: | activemodel/lib/active_model/validations/absence.rb |
Overview
Active Model Absence Validator
Class Method Summary
::ActiveModel::EachValidator
- Inherited
.new | Returns a new validator instance. |
::ActiveModel::Validator
- Inherited
Instance Attribute Summary
Instance Method Summary
::ActiveModel::EachValidator
- Inherited
#check_validity! | Hook method that gets called by the initializer allowing verification that the arguments supplied are valid. |
#validate | Performs validation on the supplied record. |
#validate_each | Override this method in subclasses with the validation logic, adding errors to the records #errors array where necessary. |
#prepare_value_for_validation |
::ActiveModel::Validator
- Inherited
Constructor Details
This class inherits a constructor from ActiveModel::EachValidator
Instance Method Details
#validate_each(record, attr_name, value)
[ GitHub ]# File 'activemodel/lib/active_model/validations/absence.rb', line 7
def validate_each(record, attr_name, value) record.errors.add(attr_name, :present, ** ) if value.present? end