aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-14 04:34:00 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-02-14 05:22:41 +0900
commit4f2a635661077fd5c3097e2a4c1496760600132a (patch)
treeacd84fbe7e45d78d7f510fc6e721bd410f3e8db5 /activerecord/lib/active_record/relation.rb
parent4e4b1d05ea820ff777e4734596bb6b0d85495c42 (diff)
downloadrails-4f2a635661077fd5c3097e2a4c1496760600132a.tar.gz
rails-4f2a635661077fd5c3097e2a4c1496760600132a.tar.bz2
rails-4f2a635661077fd5c3097e2a4c1496760600132a.zip
Revert "Chaining named scope is no longer leaking to class level querying methods"
This reverts #32380, since this may cause that silently leaking information when people upgrade the app. We need deprecation first before making this.
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r--activerecord/lib/active_record/relation.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index 347d745d19..f98d9bb2c0 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -321,12 +321,12 @@ module ActiveRecord
# Please check unscoped if you want to remove all previous scopes (including
# the default_scope) during the execution of a block.
def scoping
- @delegate_to_klass && klass.current_scope(true) ? yield : _scoping(self) { yield }
+ @delegate_to_klass ? yield : _scoping(self) { yield }
end
def _exec_scope(*args, &block) # :nodoc:
@delegate_to_klass = true
- _scoping(nil) { instance_exec(*args, &block) || self }
+ instance_exec(*args, &block) || self
ensure
@delegate_to_klass = false
end