mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use Rails.application where we want a valid rack app
This commit is contained in:
parent
d859402696
commit
c1261b5484
4 changed files with 4 additions and 4 deletions
|
@ -50,7 +50,7 @@ module ActionController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
# DEPRECATE Rails application fallback
|
# DEPRECATE Rails application fallback
|
||||||
Rails.application.new
|
Rails.application
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -490,7 +490,7 @@ module ActionDispatch
|
||||||
def self.app
|
def self.app
|
||||||
# DEPRECATE Rails application fallback
|
# DEPRECATE Rails application fallback
|
||||||
# This should be set by the initializer
|
# This should be set by the initializer
|
||||||
@@app || (defined?(Rails.application) && Rails.application.new) || nil
|
@@app || (defined?(Rails.application) && Rails.application) || nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.app=(app)
|
def self.app=(app)
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
require ::File.expand_path('../config/environment', __FILE__)
|
require ::File.expand_path('../config/environment', __FILE__)
|
||||||
|
|
||||||
# Dispatch the request
|
# Dispatch the request
|
||||||
run Rails.application.new
|
run Rails.application
|
||||||
|
|
|
@ -40,7 +40,7 @@ module ApplicationTests
|
||||||
|
|
||||||
test "Rails.application is available after config.ru has been racked up" do
|
test "Rails.application is available after config.ru has been racked up" do
|
||||||
rackup
|
rackup
|
||||||
assert Rails.application.new < Rails::Application
|
assert Rails.application < Rails::Application
|
||||||
end
|
end
|
||||||
|
|
||||||
# Passenger still uses AC::Dispatcher, so we need to
|
# Passenger still uses AC::Dispatcher, so we need to
|
||||||
|
|
Loading…
Reference in a new issue