class ActiveRecord::Associations::Association

def association_scope

actually gets built.
by scope.scoping { ... } or unscoped { ... } etc, which affects the scope which
scope method is called. This is because at that point the call may be surrounded
Note that the association_scope is merged into the target_scope only when the

The scope for this association.
def association_scope
  if klass
    @association_scope ||= if disable_joins
      DisableJoinsAssociationScope.scope(self)
    else
      AssociationScope.scope(self)
    end
  end
end