Class: Ripple::Validations::AssociatedValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Ripple::Validations::AssociatedValidator
- Includes:
- Translation
- Defined in:
- lib/ripple/validations/associated_validator.rb
Instance Method Summary collapse
Methods included from Translation
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
7 8 9 10 |
# File 'lib/ripple/validations/associated_validator.rb', line 7 def validate_each(record, attribute, value) return if (value.is_a?(Array) ? value : [value]).collect{ |r| r.nil? || r.valid? }.all? record.errors.add(attribute, (attribute, value)) end |