method

_scoping

Importance_0
v7.1.3.4 - Show latest stable - 0 notes - Class: ActiveRecord::Relation
_scoping(scope, registry, all_queries = false) private

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/relation.rb, line 921
      def _scoping(scope, registry, all_queries = false)
        previous = registry.current_scope(klass, true)
        registry.set_current_scope(klass, scope)

        if all_queries
          previous_global = registry.global_current_scope(klass, true)
          registry.set_global_current_scope(klass, scope)
        end
        yield
      ensure
        registry.set_current_scope(klass, previous)
        if all_queries
          registry.set_global_current_scope(klass, previous_global)
        end
      end
Register or log in to add new notes.