Use Rails.application where we want a valid rack app

This commit is contained in:
Joshua Peek 2009-10-16 19:04:28 -05:00
parent d859402696
commit c1261b5484
4 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ module ActionController
def new
# DEPRECATE Rails application fallback
Rails.application.new
Rails.application
end
end
end

View File

@ -490,7 +490,7 @@ module ActionDispatch
def self.app
# DEPRECATE Rails application fallback
# This should be set by the initializer
@@app || (defined?(Rails.application) && Rails.application.new) || nil
@@app || (defined?(Rails.application) && Rails.application) || nil
end
def self.app=(app)

View File

@ -2,4 +2,4 @@
require ::File.expand_path('../config/environment', __FILE__)
# Dispatch the request
run Rails.application.new
run Rails.application

View File

@ -40,7 +40,7 @@ module ApplicationTests
test "Rails.application is available after config.ru has been racked up" do
rackup
assert Rails.application.new < Rails::Application
assert Rails.application < Rails::Application
end
# Passenger still uses AC::Dispatcher, so we need to