From 5dc7f34dca3a5b0bd65dff157ae547347e86670e Mon Sep 17 00:00:00 2001 From: Alvaro Bautista Date: Sat, 11 Sep 2010 21:12:10 +0200 Subject: Fix ActiveSupport::TimeWithZone#localtime method with DateTime [#5344 state:committed] Signed-off-by: Santiago Pastorino --- activesupport/lib/active_support/time_with_zone.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 93f5d5a0cc..d993ba3c2a 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -73,7 +73,7 @@ module ActiveSupport # Returns a Time.local() instance of the simultaneous time in your system's ENV['TZ'] zone def localtime - utc.getlocal + utc.is_a?(DateTime) ? utc.to_time.getlocal : utc.getlocal end alias_method :getlocal, :localtime -- cgit v1.2.3