From 3b6f659fb6b1ffd323c0bbad36630cc97b96bd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 25 Jan 2010 01:06:12 +0100 Subject: 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. --- activesupport/lib/active_support/railtie.rb | 54 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3