From 58adc6737126242d189274d83c50bcade098800a Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Mon, 3 May 2010 12:18:25 -0400 Subject: STI should not ignore type condition while applying scopes from parent class scopes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#4507 state:resolved] Signed-off-by: José Valim --- activerecord/lib/active_record/named_scope.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/named_scope.rb') diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index aeed52e72a..3d8f4a030b 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -99,11 +99,7 @@ module ActiveRecord block_given? ? relation.extending(Module.new(&block)) : relation end - singleton_class.instance_eval do - define_method name do |*args| - scopes[name].call(*args) - end - end + singleton_class.send :define_method, name, &scopes[name] end def named_scope(*args, &block) -- cgit v1.2.3