From 72385a7be65bb27b07cd2ee3bc9fe221d8e04f90 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 6 Feb 2008 06:43:02 +0000 Subject: Add Time Zone support to ActiveRecord, and config.time_zone property for specifying a default Time Zone. Closes #10982 [Geoff Buesing, rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/zones.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/time/zones.rb') diff --git a/activesupport/lib/active_support/core_ext/time/zones.rb b/activesupport/lib/active_support/core_ext/time/zones.rb index 7b9106b4ac..33c7800705 100644 --- a/activesupport/lib/active_support/core_ext/time/zones.rb +++ b/activesupport/lib/active_support/core_ext/time/zones.rb @@ -9,8 +9,10 @@ module ActiveSupport #:nodoc: end module ClassMethods + attr_accessor :zone_default + def zone - Thread.current[:time_zone] + Thread.current[:time_zone] || zone_default end # Sets a global default time zone, separate from the system time zone in ENV['TZ']. -- cgit v1.2.3