aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-03-21 20:37:14 +0000
committerJon Leighton <j@jonathanleighton.com>2012-03-21 20:37:22 +0000
commitfd68bd23b602ef2a7b038b66e787604df9192c6d (patch)
tree7914b8d668363f2c85bd9ad8a96ce1815544cd98 /activerecord/lib/active_record
parentf6db31ec16e42ee7713029f7120f0b011d1ddc6c (diff)
downloadrails-fd68bd23b602ef2a7b038b66e787604df9192c6d.tar.gz
rails-fd68bd23b602ef2a7b038b66e787604df9192c6d.tar.bz2
rails-fd68bd23b602ef2a7b038b66e787604df9192c6d.zip
Avoid obscure &Proc.new thing
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/scoping/named.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb
index 20c8e4b0f7..2f266eff79 100644
--- a/activerecord/lib/active_record/scoping/named.rb
+++ b/activerecord/lib/active_record/scoping/named.rb
@@ -171,8 +171,8 @@ module ActiveRecord
# Article.published.featured.latest_article
# Article.featured.titles
- def scope(name, scope_options = {})
- extension = Module.new(&Proc.new) if block_given?
+ def scope(name, scope_options = {}, &block)
+ extension = Module.new(&block) if block
singleton_class.send(:define_method, name) do |*args|
options = scope_options.respond_to?(:call) ? unscoped { scope_options.call(*args) } : scope_options