instance method
validate_collection_association
Ruby on Rails 6.0.6
Since v2.3.18 PrivateSignature
validate_collection_association(reflection)
Validate the associated records if :validate or :autosave is turned on for the association specified by reflection.
Parameters
-
reflectionreq
Source
# File activerecord/lib/active_record/autosave_association.rb, line 310
def validate_collection_association(reflection)
if association = association_instance_get(reflection.name)
if records = associated_records_to_validate_or_save(association, new_record?, reflection.options[:autosave])
records.each_with_index { |record, index| association_valid?(reflection, record, index) }
end
end
end
Defined in activerecord/lib/active_record/autosave_association.rb line 310
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AutosaveAssociation