aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2010-01-03 21:55:48 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2010-01-03 21:55:48 -0500
commit0422314b29e6b59362eb1111c983740784428b73 (patch)
tree2d2e9b027f7f9d13a67ca9920a61aa40a7e51b19 /railties/lib/rails/application.rb
parent51460b5bf296d7f262f8d865f6f6f1d44513c6d4 (diff)
downloadrails-0422314b29e6b59362eb1111c983740784428b73.tar.gz
rails-0422314b29e6b59362eb1111c983740784428b73.tar.bz2
rails-0422314b29e6b59362eb1111c983740784428b73.zip
Time zoning should be turned on by default with UTC
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r--railties/lib/rails/application.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 457eef648c..5e68c05d7c 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -207,18 +207,16 @@ module Rails
# Sets the default value for Time.zone
# If assigned value cannot be matched to a TimeZone, an exception will be raised.
initializer :initialize_time_zone do
- if config.time_zone
- require 'active_support/core_ext/time/zones'
- zone_default = Time.__send__(:get_zone, config.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
+ require 'active_support/core_ext/time/zones'
+ zone_default = Time.__send__(:get_zone, config.time_zone)
- Time.zone_default = zone_default
+ 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
+
+ Time.zone_default = zone_default
end
# Set the i18n configuration from config.i18n but special-case for the load_path which should be