method
instantiate
v2.3.8 -
Show latest stable
-
0 notes -
Class: ActiveRecord::Associations::ClassMethods::JoinDependency
instantiate(rows)
public
Hide source
# File activerecord/lib/active_record/associations.rb, line 1847 def instantiate(rows) rows.each_with_index do |row, i| primary_id = join_base.record_id(row) unless @base_records_hash[primary_id] @base_records_in_order << (@base_records_hash[primary_id] = join_base.instantiate(row)) end construct(@base_records_hash[primary_id], @associations, join_associations.dup, row) end remove_duplicate_results!(join_base.active_record, @base_records_in_order, @associations) return @base_records_in_order end