Flowdock
method

get_chain

Importance_0
v5.1.7 - Show latest stable - 0 notes - Class: AssociationScope
get_chain(reflection, association, tracker) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/association_scope.rb, line 110
        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),
              refl.klass.type_caster
            )
            proxy = ReflectionProxy.new(refl, alias_name)
            previous_reflection.next = proxy
            previous_reflection = proxy
          end
          [runtime_reflection, previous_reflection]
        end
Register or log in to add new notes.