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
|
||||
# DEPRECATE Rails application fallback
|
||||
Rails.application.new
|
||||
Rails.application
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
require ::File.expand_path('../config/environment', __FILE__)
|
||||
|
||||
# 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
|
||||
rackup
|
||||
assert Rails.application.new < Rails::Application
|
||||
assert Rails.application < Rails::Application
|
||||
end
|
||||
|
||||
# Passenger still uses AC::Dispatcher, so we need to
|
||||
|
|
Loading…
Reference in a new issue