diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-17 03:54:52 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-17 03:54:52 +0530 |
commit | b8b6621acbc26a41421e9f9daded9b2a9ab82f1b (patch) | |
tree | 7432ecc411bec42d1ad8db440fec959568457089 /activerecord | |
parent | 603d4fbacd69d95987d3f7fed91631e481f5a1cf (diff) | |
download | rails-b8b6621acbc26a41421e9f9daded9b2a9ab82f1b.tar.gz rails-b8b6621acbc26a41421e9f9daded9b2a9ab82f1b.tar.bz2 rails-b8b6621acbc26a41421e9f9daded9b2a9ab82f1b.zip |
Simplify Model.scoped definition
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 8 |
1 files changed, 1 insertions, 7 deletions
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 |