From b54bbea3e49390bfdabad00430732b5a48850338 Mon Sep 17 00:00:00 2001 From: Bradford Folkens Date: Thu, 10 Jul 2008 11:37:07 -0500 Subject: [PATCH] Fixed blockless step in Range - broke default value (n=1) --- .../core_ext/range/blockless_step.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/range/blockless_step.rb b/activesupport/lib/active_support/core_ext/range/blockless_step.rb index 39dac85..6fa1eb5 100644 --- a/activesupport/lib/active_support/core_ext/range/blockless_step.rb +++ b/activesupport/lib/active_support/core_ext/range/blockless_step.rb @@ -8,7 +8,7 @@ module ActiveSupport #:nodoc: end if RUBY_VERSION < '1.9' - def step_with_blockless(value, &block) + def step_with_blockless(value = 1, &block) if block_given? step_without_blockless(value, &block) else @@ -18,7 +18,7 @@ module ActiveSupport #:nodoc: end end else - def step_with_blockless(value, &block) + def step_with_blockless(value = 1, &block) if block_given? step_without_blockless(value, &block) else -- 1.5.5.3