Time zoning should be turned on by default with UTC

This commit is contained in:
David Heinemeier Hansson 2010-01-03 21:55:48 -05:00
parent 51460b5bf2
commit 0422314b29
4 changed files with 17 additions and 14 deletions

@ -1,5 +1,7 @@
*Edge*
* Set config.time_zone to UTC by default [DHH]
* Added default .gitignore (this is just recognizing Git market share, don't throw a hissy if you use another SCM) [DHH]
* Added cookies.permanent, cookies.signed, and cookies.permanent.signed accessor for common cookie actions [DHH]. Examples:

@ -207,7 +207,6 @@ def call(env)
# 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)
@ -219,7 +218,6 @@ def call(env)
Time.zone_default = zone_default
end
end
# Set the i18n configuration from config.i18n but special-case for the load_path which should be
# appended to what's already set instead of overwritten.

@ -231,6 +231,10 @@ def log_level
@log_level ||= RAILS_ENV == 'production' ? :info : :debug
end
def time_zone
@time_zone ||= "UTC"
end
def i18n
@i18n ||= begin
i18n = ActiveSupport::OrderedOptions.new

@ -17,15 +17,14 @@ class Application < Rails::Application
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'UTC'
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de
# Configure generators values. Many other options are available, be sure to
# check the documentation.
# Configure generators values. Many other options are available, be sure to check the documentation.
# config.generators do |g|
# g.orm :active_record
# g.template_engine :erb