Flowdock
method

build_default_scope

Importance_0
v3.2.8 - Show latest stable - 0 notes - Class: ClassMethods
build_default_scope() protected

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/scoping/default.rb, line 100
        def build_default_scope #:nodoc:
          if method(:default_scope).owner != ActiveRecord::Scoping::Default::ClassMethods
            evaluate_default_scope { default_scope }
          elsif default_scopes.any?
            evaluate_default_scope do
              default_scopes.inject(relation) do |default_scope, scope|
                if scope.is_a?(Hash)
                  default_scope.apply_finder_options(scope)
                elsif !scope.is_a?(Relation) && scope.respond_to?(:call)
                  default_scope.merge(scope.call)
                else
                  default_scope.merge(scope)
                end
              end
            end
          end
        end
Register or log in to add new notes.