From 77697e03353ec06a4b12f42a32d7569797d1eb8f Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 6 Nov 2008 17:10:16 -0600 Subject: [PATCH] Fix memory leak issue in ActiveRecord scoped_methods --- activerecord/lib/active_record/base.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index a36a137f0d..757102eb6b 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2023,8 +2023,7 @@ def scope(method, key = nil) #:nodoc: end def scoped_methods #:nodoc: - scoped_methods = (Thread.current[:scoped_methods] ||= {}) - scoped_methods[self] ||= [] + Thread.current[:"#{self}_scoped_methods"] ||= [] end def current_scoped_methods #:nodoc: -- GitLab