From 254938444caea99829dd3c2777f5a316525a0a98 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 10 Sep 2010 22:43:02 +0700 Subject: [PATCH] Use `Time.current` to maintain consistency with AS::Duration In [32b82e4c6f5523cdf5ee78c3022c50b46e018351], the committer has switch methods in AS::Duration to use `Time.current` to return the correct duration based on the `Time.default_zone` instead of using `Time.now`. --- .../lib/active_support/core_ext/numeric/time.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/numeric/time.rb b/activesupport/lib/active_support/core_ext/numeric/time.rb index bc7f180..4921e15 100644 --- a/activesupport/lib/active_support/core_ext/numeric/time.rb +++ b/activesupport/lib/active_support/core_ext/numeric/time.rb @@ -61,7 +61,7 @@ module ActiveSupport #:nodoc: alias :fortnight :fortnights # Reads best without arguments: 10.minutes.ago - def ago(time = ::Time.now) + def ago(time = ::Time.current) time - self end @@ -69,7 +69,7 @@ module ActiveSupport #:nodoc: alias :until :ago # Reads best with argument: 10.minutes.since(time) - def since(time = ::Time.now) + def since(time = ::Time.current) time + self end -- 1.7.2.3