method
get_chain
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::Associations::AssociationScope
get_chain(reflection, association, tracker)private
No documentation available.
# File activerecord/lib/active_record/associations/association_scope.rb, line 108
def get_chain(reflection, association, tracker)
name = reflection.name
runtime_reflection = Reflection::RuntimeReflection.new(reflection, association)
previous_reflection = runtime_reflection
reflection.chain.drop(1).each do |refl|
alias_name = tracker.aliased_table_for(refl.table_name, refl.alias_candidate(name))
proxy = ReflectionProxy.new(refl, alias_name)
previous_reflection.next = proxy
previous_reflection = proxy
end
[runtime_reflection, previous_reflection]
end