diff options
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 6ab84df25b..b767a2b4a8 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -97,11 +97,11 @@ module ActiveRecord # # Article.published.new.published # => true # Article.published.create.published # => true - def scope(name, scope_options = {}, &block) + def scope(name, scope_options = {}) name = name.to_sym valid_scope_name?(name) - extension = Module.new(&block) if block_given? + extension = Module.new(&Proc.new) if block_given? scopes[name] = lambda do |*args| options = scope_options.is_a?(Proc) ? scope_options.call(*args) : scope_options |