From 7b71d8cfabe71dc9cf265809eed51e6956b60b7f Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Sat, 18 Oct 2014 13:04:02 -0700 Subject: Revert "Replace (slower) block.call with (faster) yield" This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6. --- activesupport/lib/active_support/testing/time_helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/testing/time_helpers.rb b/activesupport/lib/active_support/testing/time_helpers.rb index 8c63815660..1112c6e0b1 100644 --- a/activesupport/lib/active_support/testing/time_helpers.rb +++ b/activesupport/lib/active_support/testing/time_helpers.rb @@ -90,7 +90,7 @@ module ActiveSupport # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 # end # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 - def travel_to(date_or_time) + def travel_to(date_or_time, &block) if date_or_time.is_a?(Date) && !date_or_time.is_a?(DateTime) now = date_or_time.midnight.to_time else @@ -102,7 +102,7 @@ module ActiveSupport if block_given? begin - yield + block.call ensure travel_back end -- cgit v1.2.3