Class: ActiveModel::Validations::PresenceValidator
- Inherits:
-
EachValidator
- Object
- ActiveModel::Validator
- EachValidator
- ActiveModel::Validations::PresenceValidator
- Defined in:
- lib/active_model/validations/presence.rb
Overview
:nodoc:
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
6 7 8 |
# File 'lib/active_model/validations/presence.rb', line 6 def validate_each(record, attr_name, value) record.errors.add(attr_name, :blank, ) if value.blank? end |