diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-25 01:06:12 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-25 01:12:22 +0100 |
commit | 3b6f659fb6b1ffd323c0bbad36630cc97b96bd5f (patch) | |
tree | acd1fdb20cd5a63e6867c2befb07de8f46ab66ec /activesupport/lib/active_support | |
parent | 396003fc48d7c0ba206ad059646c7414bee22a36 (diff) | |
download | rails-3b6f659fb6b1ffd323c0bbad36630cc97b96bd5f.tar.gz rails-3b6f659fb6b1ffd323c0bbad36630cc97b96bd5f.tar.bz2 rails-3b6f659fb6b1ffd323c0bbad36630cc97b96bd5f.zip |
Add active_model/railtie back to generated boot.rb, add models back to paths, load active_support/railtie since we need it and ensure default logger is set before config.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/railtie.rb | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index 55608ac1c5..bc0f99869c 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -1,6 +1,33 @@ require "active_support" require "rails" +module ActiveSupport + class Railtie < Rails::Railtie + railtie_name :active_support + + # Loads support for "whiny nil" (noisy warnings when methods are invoked + # on +nil+ values) if Configuration#whiny_nils is true. + initializer :initialize_whiny_nils do |app| + require 'active_support/whiny_nil' if app.config.whiny_nils + end + + # 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 |app| + require 'active_support/core_ext/time/zones' + zone_default = Time.__send__(:get_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 + module I18n class Railtie < Rails::Railtie railtie_name :i18n @@ -30,31 +57,4 @@ module I18n I18n.reload! end end -end - -module ActiveSupport - class Railtie < Rails::Railtie - railtie_name :active_support - - # Loads support for "whiny nil" (noisy warnings when methods are invoked - # on +nil+ values) if Configuration#whiny_nils is true. - initializer :initialize_whiny_nils do |app| - require 'active_support/whiny_nil' if app.config.whiny_nils - end - - # 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 |app| - require 'active_support/core_ext/time/zones' - zone_default = Time.__send__(:get_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
\ No newline at end of file |