method
construct_model
v4.2.7 -
Show latest stable
- Class:
ActiveRecord::Associations::JoinDependency
construct_model(record, node, row, model_cache, id, aliases)private
No documentation available.
# File activerecord/lib/active_record/associations/join_dependency.rb, line 272
def construct_model(record, node, row, model_cache, id, aliases)
model = model_cache[node][id] ||= node.instantiate(row,
aliases.column_aliases(node))
other = record.association(node.reflection.name)
if node.reflection.collection?
other.target.push(model)
else
other.target = model
end
other.set_inverse_instance(model)
model
end