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/association_scope.rb, line 21
      def scope(association)
        klass = association.klass
        reflection = association.reflection
        scope = klass.unscoped
        owner = association.owner
        chain = get_chain(reflection, association, scope.alias_tracker)

        scope.extending! reflection.extensions
        scope = add_constraints(scope, owner, chain)
        scope.limit!(1) unless reflection.collection?
        scope
      end
Register or log in to add new notes.