From b658cf1198bbeb0fb702cd10c6f491cd90cedba0 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 27 Jul 2012 17:27:47 +0100 Subject: Deprecate ActiveRecord::Base.scoped. It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders. --- activerecord/lib/active_record/scoping/named.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/scoping/named.rb') diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index 54de30fe7d..4cd86cefe1 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -34,10 +34,6 @@ module ActiveRecord end end - def scoped(options = nil) - options ? all.merge!(options) : all - end - ## # Collects attributes from scopes that should be applied when creating # an AR instance for the particular class this is called on. @@ -186,7 +182,7 @@ module ActiveRecord singleton_class.send(:define_method, name) do |*args| options = body.respond_to?(:call) ? unscoped { body.call(*args) } : body - relation = scoped.merge(options) + relation = all.merge(options) extension ? relation.extending(extension) : relation end -- cgit v1.2.3