From c1261b5484c10930be9f737abfc164f9ba072629 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 16 Oct 2009 19:04:28 -0500 Subject: Use Rails.application where we want a valid rack app --- actionpack/lib/action_controller/dispatch/dispatcher.rb | 2 +- actionpack/lib/action_dispatch/testing/integration.rb | 2 +- railties/lib/rails/generators/rails/app/templates/config.ru | 2 +- railties/test/application/load_test.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/dispatch/dispatcher.rb b/actionpack/lib/action_controller/dispatch/dispatcher.rb index 008fb54715..e04da42637 100644 --- a/actionpack/lib/action_controller/dispatch/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatch/dispatcher.rb @@ -50,7 +50,7 @@ module ActionController def new # DEPRECATE Rails application fallback - Rails.application.new + Rails.application end end end diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 58ebe94a5b..40d6f97b2a 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -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) diff --git a/railties/lib/rails/generators/rails/app/templates/config.ru b/railties/lib/rails/generators/rails/app/templates/config.ru index f854029193..509a0da5b7 100644 --- a/railties/lib/rails/generators/rails/app/templates/config.ru +++ b/railties/lib/rails/generators/rails/app/templates/config.ru @@ -2,4 +2,4 @@ require ::File.expand_path('../config/environment', __FILE__) # Dispatch the request -run Rails.application.new +run Rails.application diff --git a/railties/test/application/load_test.rb b/railties/test/application/load_test.rb index 5c3d35fb16..3da51c4355 100644 --- a/railties/test/application/load_test.rb +++ b/railties/test/application/load_test.rb @@ -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 -- cgit v1.2.3