diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 17:27:47 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 17:27:47 +0100 |
commit | b658cf1198bbeb0fb702cd10c6f491cd90cedba0 (patch) | |
tree | e3163ecc180fd799659ab4d9579f91c5ff293f5a /activerecord/lib/active_record/scoping | |
parent | 6a81ccd69d96f36f4322ef927191ab5a35e68d68 (diff) | |
download | rails-b658cf1198bbeb0fb702cd10c6f491cd90cedba0.tar.gz rails-b658cf1198bbeb0fb702cd10c6f491cd90cedba0.tar.bz2 rails-b658cf1198bbeb0fb702cd10c6f491cd90cedba0.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record/scoping')
-rw-r--r-- | activerecord/lib/active_record/scoping/named.rb | 6 |
1 files changed, 1 insertions, 5 deletions
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 |