Sets the default value for Time.zone, and turns on
ActiveRecord::Base#time_zone_aware_attributes. If assigned value cannot be
matched to a TimeZone, an exception will be
raised.
# File railties/lib/initializer.rb, line 495
def initialize_time_zone
if 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
Time.zone_default = zone_default
if configuration.frameworks.include?(:active_record)
ActiveRecord::Base.time_zone_aware_attributes = true
ActiveRecord::Base.default_timezone = :utc
end
end
end