From b8b6621acbc26a41421e9f9daded9b2a9ab82f1b Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 17 Jan 2010 03:54:52 +0530 Subject: Simplify Model.scoped definition --- activerecord/lib/active_record/named_scope.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 90fd700437..bc04ffc089 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -26,13 +26,7 @@ module ActiveRecord if options.present? Scope.new(self, options, &block) else - current_scope = current_scoped_methods - - unless current_scope - unscoped.spawn - else - construct_finder_arel({}, current_scoped_methods) - end + current_scoped_methods ? unscoped.merge(current_scoped_methods) : unscoped.spawn end end -- cgit v1.2.3