Class: Dynamoid::Validations::ClassMethods::PresenceValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Dynamoid::Validations::ClassMethods::PresenceValidator
- Defined in:
- lib/dynamoid/validations.rb
Overview
Validates that the specified attributes are present (false or not blank).
Instance Method Summary collapse
-
#validate_each(record, attr_name, value) ⇒ Object
Validate the record for the record and value.
Instance Method Details
#validate_each(record, attr_name, value) ⇒ Object
Validate the record for the record and value.
50 51 52 |
# File 'lib/dynamoid/validations.rb', line 50 def validate_each(record, attr_name, value) record.errors.add(attr_name, :blank, ) if not_present?(value) end |