diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-04-22 11:44:55 +0200 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-04-25 15:45:06 +0100 |
commit | 618c5fc3c0f4d1d5bee8c8f8e517b6bfacd17dc2 (patch) | |
tree | 96288ff5e39150db9e35e03586dfce4ba006d296 /activerecord/lib | |
parent | ef1d1e1492e3c48884f7653103bc9313dd04cfad (diff) | |
download | rails-618c5fc3c0f4d1d5bee8c8f8e517b6bfacd17dc2.tar.gz rails-618c5fc3c0f4d1d5bee8c8f8e517b6bfacd17dc2.tar.bz2 rails-618c5fc3c0f4d1d5bee8c8f8e517b6bfacd17dc2.zip |
Extract deprecated code
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/scoping/named.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index b43e08157a..5943baf93b 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -29,17 +29,16 @@ module ActiveRecord # You can define a \scope that applies to all finders using # ActiveRecord::Base.default_scope. def scoped(options = nil) - if options - scoped.apply_finder_options(options) + if current_scope + scope = current_scope.clone else - if current_scope - current_scope.clone - else - scope = relation - scope.default_scoped = true - scope - end + scope = relation + scope.default_scoped = true + scope end + + scope.merge!(options) if options + scope end ## |