mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Create separate middleware stack for initializer
This commit is contained in:
@@ -108,10 +108,9 @@ module Rails
|
||||
defined?(::RAILS_FRAMEWORK_ROOT) ? ::RAILS_FRAMEWORK_ROOT : "#{root_path}/vendor/rails"
|
||||
end
|
||||
|
||||
# TODO: Fix this when there is an application object
|
||||
def middleware
|
||||
require 'action_controller'
|
||||
ActionController::Dispatcher.middleware
|
||||
require 'action_dispatch'
|
||||
@middleware ||= ActionDispatch::MiddlewareStack.new
|
||||
end
|
||||
|
||||
# Loads and returns the contents of the #database_configuration_file. The
|
||||
|
||||
@@ -608,6 +608,7 @@ Run `rake gems:install` to install the missing gems.
|
||||
|
||||
Initializer.default.add :build_application do
|
||||
if configuration.frameworks.include?(:action_controller)
|
||||
ActionController::Dispatcher.middleware = configuration.middleware
|
||||
Rails.application = Rails::Application.new
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,8 +5,6 @@ uses_gem "fcgi", "0.8.7" do
|
||||
require 'action_controller'
|
||||
require 'rails/fcgi_handler'
|
||||
|
||||
Dispatcher.middleware.clear
|
||||
|
||||
class RailsFCGIHandlerTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@log = StringIO.new
|
||||
|
||||
Reference in New Issue
Block a user