aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/named_scope.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-17 03:54:52 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-17 03:54:52 +0530
commitb8b6621acbc26a41421e9f9daded9b2a9ab82f1b (patch)
tree7432ecc411bec42d1ad8db440fec959568457089 /activerecord/lib/active_record/named_scope.rb
parent603d4fbacd69d95987d3f7fed91631e481f5a1cf (diff)
downloadrails-b8b6621acbc26a41421e9f9daded9b2a9ab82f1b.tar.gz
rails-b8b6621acbc26a41421e9f9daded9b2a9ab82f1b.tar.bz2
rails-b8b6621acbc26a41421e9f9daded9b2a9ab82f1b.zip
Simplify Model.scoped definition
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r--activerecord/lib/active_record/named_scope.rb8
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