diff options
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r-- | railties/lib/initializer.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 06a3332c42..619701460d 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -39,7 +39,7 @@ module Rails nil end end - + def backtrace_cleaner @@backtrace_cleaner ||= begin # Relies on ActiveSupport, so we have to lazy load to postpone definition until AS has been loaded @@ -148,7 +148,6 @@ module Rails initialize_dependency_mechanism initialize_whiny_nils - initialize_temporary_session_directory initialize_time_zone initialize_i18n @@ -156,6 +155,8 @@ module Rails initialize_framework_settings initialize_framework_views + initialize_metal + add_support_load_paths load_gems @@ -369,8 +370,9 @@ Run `rake gems:install` to install the missing gems. def load_view_paths if configuration.frameworks.include?(:action_view) if configuration.cache_classes - ActionController::Base.view_paths.load if configuration.frameworks.include?(:action_controller) - ActionMailer::Base.template_root.load if configuration.frameworks.include?(:action_mailer) + view_path = ActionView::Template::EagerPath.new(configuration.view_path) + ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) + ActionMailer::Base.template_root = view_path if configuration.frameworks.include?(:action_mailer) end end end @@ -472,7 +474,7 @@ Run `rake gems:install` to install the missing gems. # set to use Configuration#view_path. def initialize_framework_views if configuration.frameworks.include?(:action_view) - view_path = ActionView::PathSet::Path.new(configuration.view_path, false) + view_path = ActionView::Template::Path.new(configuration.view_path) ActionMailer::Base.template_root ||= view_path if configuration.frameworks.include?(:action_mailer) ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) && ActionController::Base.view_paths.empty? end @@ -501,13 +503,6 @@ Run `rake gems:install` to install the missing gems. require('active_support/whiny_nil') if configuration.whiny_nils end - def initialize_temporary_session_directory - if configuration.frameworks.include?(:action_controller) - session_path = "#{configuration.root_path}/tmp/sessions/" - ActionController::Base.session_options[:tmpdir] = File.exist?(session_path) ? session_path : Dir::tmpdir - end - end - # 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. def initialize_time_zone @@ -529,7 +524,7 @@ Run `rake gems:install` to install the missing gems. end end - # Set the i18n configuration from config.i18n but special-case for the load_path which should be + # 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. def initialize_i18n configuration.i18n.each do |setting, value| @@ -541,6 +536,10 @@ Run `rake gems:install` to install the missing gems. end end + def initialize_metal + configuration.middleware.insert_before(:"ActionController::VerbPiggybacking", Rails::Rack::Metal) + end + # Initializes framework-specific settings for each of the loaded frameworks # (Configuration#frameworks). The available settings map to the accessors # on each of the corresponding Base classes. @@ -923,6 +922,7 @@ Run `rake gems:install` to install the missing gems. # Followed by the standard includes. paths.concat %w( app + app/metal app/models app/controllers app/helpers @@ -941,6 +941,7 @@ Run `rake gems:install` to install the missing gems. def default_eager_load_paths %w( + app/metal app/models app/controllers app/helpers |