diff options
author | wangjohn <wangjohn@mit.edu> | 2013-04-08 02:56:21 -0400 |
---|---|---|
committer | wangjohn <wangjohn@mit.edu> | 2013-04-08 13:21:13 -0400 |
commit | 5b945f2685bf9ec77ddf0d79d09f0000d827cd22 (patch) | |
tree | 7f843c6e3005202756bd2eea01c5f36f84623552 /activerecord/lib/active_record/scoping | |
parent | 63f7356b3ae5d5f9a0710e52f6392bdcd269d903 (diff) | |
download | rails-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.rb | 4 |
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 |