From dc0aed1151f418c417770539629d26fa34c03815 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 8 Sep 2008 18:08:48 -0700 Subject: Don't shadow arg with block var --- activesupport/lib/active_support/core_ext/enumerable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/enumerable.rb') diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index fd94bc051f..788f3a7e9e 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -77,9 +77,9 @@ module Enumerable # (1..5).each_with_object(1) { |value, memo| memo *= value } # => 1 # def each_with_object(memo, &block) - returning memo do |memo| + returning memo do |m| each do |element| - block.call(element, memo) + block.call(element, m) end end end unless [].respond_to?(:each_with_object) -- cgit v1.2.3