Validate the associated records if :validate or :autosave
is turned on for the association specified by reflection.
# File activerecord/lib/active_record/autosave_association.rb, line 324
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