From ebb5e4f44976ff41f458d3a83b8fe417934d0dbb Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sun, 4 Jul 2010 13:34:41 +0100 Subject: [PATCH] The "scoped" method uses a named_scope attached to ActiveRecord::Base. The condition is always true in this case when it shouldn't be. This is a massive slow-down and memory leak. --- activerecord/lib/active_record/named_scope.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 21a544a..ba5241e 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -89,7 +89,7 @@ module ActiveRecord when Hash options when Proc - if self.model_name != parent_scope.model_name + if self != Base && self.model_name != parent_scope.model_name parent_scope.instance_exec(*args, &options) else options.call(*args) -- 1.7.1