Class: ActiveModel::Validations::AbsenceValidator
- Inherits:
-
EachValidator
- Object
- ActiveModel::Validator
- EachValidator
- ActiveModel::Validations::AbsenceValidator
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/lib/active_model/validations/absence.rb
Overview
Active Model Absence Validator
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from EachValidator
Attributes inherited from ActiveModel::Validator
Instance Method Summary collapse
Methods inherited from EachValidator
#check_validity!, #initialize, #validate
Methods inherited from ActiveModel::Validator
#initialize, kind, #kind, #validate
Constructor Details
This class inherits a constructor from ActiveModel::EachValidator
Instance Method Details
#validate_each(record, attr_name, value) ⇒ Object
:nodoc:
7 8 9 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/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 |