Skip to content

Commit

Permalink
Fix memory leak issue in ActiveRecord scoped_methods
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Nov 6, 2008
1 parent 4ccbc5d commit 77697e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions activerecord/lib/active_record/base.rb
Expand Up @@ -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:
Expand Down

0 comments on commit 77697e0

Please sign in to comment.