From c62db052a0c188c405ad97abec9dd2cec2b9b1d8 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Fri, 28 Mar 2008 04:35:48 +0000 Subject: config.time_zone and TimeWithZone#marshal_load accept tzinfo/Olson identifiers git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/CHANGELOG | 2 ++ railties/lib/initializer.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 00d760e99f..97f3b8cf7c 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* config.time_zone accepts TZInfo::Timezone identifiers as well as Rails TimeZone identifiers [Geoff Buesing] + * Rails::Initializer#initialize_time_zone raises an error if value assigned to config.time_zone is not recognized. Rake time zone tasks only require ActiveSupport instead of entire environment [Geoff Buesing] * Stop adding the antiquated test/mocks/* directories and only add them to the path if they're still there for legacy reasons [DHH] diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 9909e6e45e..c60fe3d700 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -353,7 +353,7 @@ module Rails # If assigned value cannot be matched to a TimeZone, an exception will be raised. def initialize_time_zone if configuration.time_zone - zone_default = TimeZone[configuration.time_zone] + zone_default = Time.send!(:get_zone, configuration.time_zone) unless zone_default raise "Value assigned to config.time_zone not recognized. Run `rake -D time` for a list of tasks for finding appropriate time zone names." end -- cgit v1.2.3