Class: Validatable::ValidatesAssociated
- Inherits:
-
ValidationBase
- Object
- ValidationBase
- Validatable::ValidatesAssociated
- Defined in:
- lib/validatable/validations/validates_associated.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from ValidationBase
#after_validate, #allow_blank, #allow_nil, #attribute, #if, #klass
Instance Method Summary collapse
Methods inherited from ValidationBase
Constructor Details
This class inherits a constructor from Validatable::ValidationBase
Instance Method Details
#message(instance) ⇒ Object
9 10 11 |
# File 'lib/validatable/validations/validates_associated.rb', line 9 def (instance) super || "is invalid" end |
#valid?(instance) ⇒ Boolean
3 4 5 6 7 |
# File 'lib/validatable/validations/validates_associated.rb', line 3 def valid?(instance) Array(instance.send(attribute)).compact.map do |child| child.valid? end.all? end |