diff options
author | Jefferson Lai <jefflai2@gmail.com> | 2014-02-10 03:00:05 -0800 |
---|---|---|
committer | Jefferson Lai <jefflai2@gmail.com> | 2014-04-23 17:21:45 -0700 |
commit | 9c3afdc327132c7f1f4d05eebc0c05b715442e7d (patch) | |
tree | 9c85b61fc019ee4c5a91fa4cf02bf39fd81fe008 /activerecord/lib/active_record/scoping.rb | |
parent | 9ed0cf51b467907810ef3959c8e9cdf77370370e (diff) | |
download | rails-9c3afdc327132c7f1f4d05eebc0c05b715442e7d.tar.gz rails-9c3afdc327132c7f1f4d05eebc0c05b715442e7d.tar.bz2 rails-9c3afdc327132c7f1f4d05eebc0c05b715442e7d.zip |
Fixes Issue #13466.
Changed the call to a scope block to be evaluated with instance_eval.
The result is that ScopeRegistry can use the actual class instead of base_class when
caching scopes so queries made by classes with a common ancestor won't leak scopes.
Diffstat (limited to 'activerecord/lib/active_record/scoping.rb')
-rw-r--r-- | activerecord/lib/active_record/scoping.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/scoping.rb b/activerecord/lib/active_record/scoping.rb index 3e43591672..fca4f1c9d3 100644 --- a/activerecord/lib/active_record/scoping.rb +++ b/activerecord/lib/active_record/scoping.rb @@ -11,11 +11,11 @@ module ActiveRecord module ClassMethods def current_scope #:nodoc: - ScopeRegistry.value_for(:current_scope, base_class.to_s) + ScopeRegistry.value_for(:current_scope, self.to_s) end def current_scope=(scope) #:nodoc: - ScopeRegistry.set_value_for(:current_scope, base_class.to_s, scope) + ScopeRegistry.set_value_for(:current_scope, self.to_s, scope) end end |