instance method
_scoping
Ruby on Rails 7.0.10
Since v6.0.6 Private — implementation detail, not part of the public APISignature
_scoping(scope, registry, all_queries = false)
No documentation comment.
Parameters
-
scopereq -
registryreq -
all_queriesopt = false
Source
# File activerecord/lib/active_record/relation.rb, line 873
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
Defined in activerecord/lib/active_record/relation.rb line 873
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation