aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-01-23 18:49:54 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-01-23 18:49:54 +0000
commitcb8de22dfb7a6dd5cb5bdca0d38ae797925e89d7 (patch)
tree65c68554635c0a462b3318ccd0534d3d29d83508 /activesupport/lib/active_support
parentb2fa70a8e1a7a02873e54bb38abafabdd103476a (diff)
downloadrails-cb8de22dfb7a6dd5cb5bdca0d38ae797925e89d7.tar.gz
rails-cb8de22dfb7a6dd5cb5bdca0d38ae797925e89d7.tar.bz2
rails-cb8de22dfb7a6dd5cb5bdca0d38ae797925e89d7.zip
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
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/time/zones.rb4
1 files changed, 2 insertions, 2 deletions
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