scope() 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 16
      def scope
        scope = klass.unscoped
        scope = scope.extending(*Array.wrap(options[:extend]))

        # It's okay to just apply all these like this. The options will only be present if the
        # association supports that option; this is enforced by the association builder.
        scope = scope.apply_finder_options(options.slice(
          :readonly, :include, :order, :limit, :joins, :group, :having, :offset, :select))

        if options[:through] && !options[:include]
          scope = scope.includes(source_options[:include])
        end

        scope = scope.uniq if options[:uniq]

        add_constraints(scope)
      end
Register or log in to add new notes.