method

scope

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: DisableJoinsAssociationScope
scope(association) public

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/disable_joins_association_scope.rb, line 6
      def scope(association)
        source_reflection = association.reflection
        owner = association.owner
        unscoped = association.klass.unscoped
        reverse_chain = get_chain(source_reflection, association, unscoped.alias_tracker).reverse

        last_reflection, last_ordered, last_join_ids = last_scope_chain(reverse_chain, owner)

        add_constraints(last_reflection, last_reflection.join_primary_key, last_join_ids, owner, last_ordered)
      end
Register or log in to add new notes.