Class: Dinamo::Model::Validation::PresenceValidator
- Inherits:
-
EachValidator
- Object
- Validator
- EachValidator
- Dinamo::Model::Validation::PresenceValidator
- Defined in:
- lib/dinamo/model/validations/presence.rb
Instance Attribute Summary
Attributes inherited from EachValidator
Attributes inherited from Validator
Instance Method Summary collapse
Methods inherited from EachValidator
Methods inherited from Validator
Constructor Details
This class inherits a constructor from Dinamo::Model::Validation::EachValidator
Instance Method Details
#validate_each(record, key, value) ⇒ Object
4 5 6 |
# File 'lib/dinamo/model/validations/presence.rb', line 4 def validate_each(record, key, value) record.errors.add(key, :blank) if value.blank? end |