From cb8de22dfb7a6dd5cb5bdca0d38ae797925e89d7 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Wed, 23 Jan 2008 18:49:54 +0000 Subject: Time #in_current_time_zone and #change_time_zone_to_current return self when Time.zone is nil git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8708 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/zones.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/time/zones.rb b/activesupport/lib/active_support/core_ext/time/zones.rb index 563d522d9a..390d4128a1 100644 --- a/activesupport/lib/active_support/core_ext/time/zones.rb +++ b/activesupport/lib/active_support/core_ext/time/zones.rb @@ -46,7 +46,7 @@ module ActiveSupport #:nodoc: # Returns the simultaneous time in Time.zone def in_current_time_zone - in_time_zone(::Time.zone) + ::Time.zone ? in_time_zone(::Time.zone) : self end # Replaces the existing zone; leaves time value intact. Examples: @@ -60,7 +60,7 @@ module ActiveSupport #:nodoc: # Replaces the existing zone to Time.zone; leaves time value intact def change_time_zone_to_current - change_time_zone(::Time.zone) + ::Time.zone ? change_time_zone(::Time.zone) : self end end end -- cgit v1.2.3