diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-04-22 12:28:26 +0200 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-04-25 15:45:06 +0100 |
commit | af27c8b0418fb41e51b6d096b0ab0228ff773e37 (patch) | |
tree | b1c7348c26f1459066871e35c0f201be47a7703b /activerecord/lib/active_record | |
parent | 618c5fc3c0f4d1d5bee8c8f8e517b6bfacd17dc2 (diff) | |
download | rails-af27c8b0418fb41e51b6d096b0ab0228ff773e37.tar.gz rails-af27c8b0418fb41e51b6d096b0ab0228ff773e37.tar.bz2 rails-af27c8b0418fb41e51b6d096b0ab0228ff773e37.zip |
extract deprecated code
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/scoping/named.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index 5943baf93b..2af476c1ba 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -171,7 +171,7 @@ module ActiveRecord # Article.published.featured.latest_article # Article.featured.titles - def scope(name, body = {}, &block) + def scope(name, body, &block) extension = Module.new(&block) if block # Check body.is_a?(Relation) to prevent the relation actually being @@ -188,9 +188,7 @@ module ActiveRecord end singleton_class.send(:define_method, name) do |*args| - options = body.respond_to?(:call) ? unscoped { body.call(*args) } : body - options = scoped.apply_finder_options(options) if options.is_a?(Hash) - + options = body.respond_to?(:call) ? unscoped { body.call(*args) } : body relation = scoped.merge(options) extension ? relation.extending(extension) : relation |