aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/scoping
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-04-08 02:56:21 -0400
committerwangjohn <wangjohn@mit.edu>2013-04-08 13:21:13 -0400
commit5b945f2685bf9ec77ddf0d79d09f0000d827cd22 (patch)
tree7f843c6e3005202756bd2eea01c5f36f84623552 /activerecord/lib/active_record/scoping
parent63f7356b3ae5d5f9a0710e52f6392bdcd269d903 (diff)
downloadrails-5b945f2685bf9ec77ddf0d79d09f0000d827cd22.tar.gz
rails-5b945f2685bf9ec77ddf0d79d09f0000d827cd22.tar.bz2
rails-5b945f2685bf9ec77ddf0d79d09f0000d827cd22.zip
Grouping thread locals in the ActiveRecord scopes so that the
current_scope and ignore_default_scope locals are brought together under a registry object.
Diffstat (limited to 'activerecord/lib/active_record/scoping')
-rw-r--r--activerecord/lib/active_record/scoping/default.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index 8a90528ce8..daee771669 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -120,11 +120,11 @@ module ActiveRecord
end
def ignore_default_scope? # :nodoc:
- Thread.current["#{self}_ignore_default_scope"]
+ ScopeRegistry.current.value_for(:ignore_default_scope, self)
end
def ignore_default_scope=(ignore) # :nodoc:
- Thread.current["#{self}_ignore_default_scope"] = ignore
+ ScopeRegistry.current.set_value_for(:ignore_default_scope, self, ignore)
end
# The ignore_default_scope flag is used to prevent an infinite recursion