diff options
author | Zachary Scott <e@zzak.io> | 2014-10-18 13:04:02 -0700 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2014-10-18 13:04:02 -0700 |
commit | 7b71d8cfabe71dc9cf265809eed51e6956b60b7f (patch) | |
tree | a501183c27ec86acd5155f50f0afd0ee5ceb371a /activesupport | |
parent | faf3616d5eecd68ef5feff504d2d18b5c533d785 (diff) | |
download | rails-7b71d8cfabe71dc9cf265809eed51e6956b60b7f.tar.gz rails-7b71d8cfabe71dc9cf265809eed51e6956b60b7f.tar.bz2 rails-7b71d8cfabe71dc9cf265809eed51e6956b60b7f.zip |
Revert "Replace (slower) block.call with (faster) yield"
This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/testing/time_helpers.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |