Class: Dragonfly::Model::Validations::PropertyValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Dragonfly::Model::Validations::PropertyValidator
- Defined in:
- lib/dragonfly/model/validations.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(model, attribute, attachment) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/dragonfly/model/validations.rb', line 9 def validate_each(model, attribute, ) if property = .send(property_name) model.errors.add(attribute, (property, model)) unless matches?(property) end rescue RuntimeError => e Dragonfly.warn("validation of property #{property_name} of #{attribute} failed with error #{e}") model.errors.add(attribute, (nil, model)) end |