aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-22 09:29:20 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-22 09:29:20 -0200
commitb45c63b8c0d8e8e92207c2d049a5d764aa12a39d (patch)
treec92ec00a834b5127cda7202066affcd1ff6e7845 /activesupport/lib/active_support
parent2bca2f6418a7167a813e63c3efc6334815f49c80 (diff)
downloadrails-b45c63b8c0d8e8e92207c2d049a5d764aa12a39d.tar.gz
rails-b45c63b8c0d8e8e92207c2d049a5d764aa12a39d.tar.bz2
rails-b45c63b8c0d8e8e92207c2d049a5d764aa12a39d.zip
Revert "Set the default timezone after the initialization since the configuration"
This reverts commit 39374aa925a7d670b039c0c0c9aa9f4aef19466b.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/railtie.rb30
1 files changed, 14 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb
index 72ac597d99..133aa6a054 100644
--- a/activesupport/lib/active_support/railtie.rb
+++ b/activesupport/lib/active_support/railtie.rb
@@ -13,6 +13,20 @@ module ActiveSupport
end
end
+ # Sets the default value for Time.zone
+ # If assigned value cannot be matched to a TimeZone, an exception will be raised.
+ initializer "active_support.initialize_time_zone" do |app|
+ require 'active_support/core_ext/time/zones'
+ zone_default = Time.find_zone!(app.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
+
+ Time.zone_default = zone_default
+ end
+
# Sets the default week start
# If assigned value is not a valid day symbol (e.g. :sunday, :monday, ...), an exception will be raised.
initializer "active_support.initialize_beginning_of_week" do |app|
@@ -28,21 +42,5 @@ module ActiveSupport
ActiveSupport.send(k, v) if ActiveSupport.respond_to? k
end
end
-
- # Sets the default value for Time.zone after initialization since the default configuration
- # lives in application initializers.
- # If assigned value cannot be matched to a TimeZone, an exception will be raised.
- config.after_initialize do |app|
- require 'active_support/core_ext/time/zones'
- zone_default = Time.find_zone!(app.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
-
- Time.zone_default = zone_default
- end
-
end
end