diff --git a/railties/lib/generators/rails/app/templates/config.ru b/railties/lib/generators/rails/app/templates/config.ru index 2ab821e38d..fcfbc6b07a 100644 --- a/railties/lib/generators/rails/app/templates/config.ru +++ b/railties/lib/generators/rails/app/templates/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -run <%= app_const %>.instance +run <%= app_const %> diff --git a/railties/lib/generators/rails/app/templates/script/console.tt b/railties/lib/generators/rails/app/templates/script/console.tt index daba8ba2f1..915c5b8294 100755 --- a/railties/lib/generators/rails/app/templates/script/console.tt +++ b/railties/lib/generators/rails/app/templates/script/console.tt @@ -2,4 +2,4 @@ require File.expand_path('../../config/boot', __FILE__) require 'rails/commands/console' require File.expand_path('../../config/application', __FILE__) -Rails::Console.start(<%= app_const %>.instance) +Rails::Console.start(<%= app_const %>) diff --git a/railties/lib/generators/rails/app/templates/script/dbconsole.tt b/railties/lib/generators/rails/app/templates/script/dbconsole.tt index a7f114a97f..a92f6f2844 100755 --- a/railties/lib/generators/rails/app/templates/script/dbconsole.tt +++ b/railties/lib/generators/rails/app/templates/script/dbconsole.tt @@ -2,4 +2,4 @@ require File.expand_path('../../config/boot', __FILE__) require 'rails/commands/dbconsole' require File.expand_path('../../config/application', __FILE__) -Rails::DBConsole.start(<%= app_const %>.instance) +Rails::DBConsole.start(<%= app_const %>) diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 5c9892c630..8366127476 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -8,7 +8,13 @@ module Rails class << self attr_writer :config alias configure class_eval - delegate :initialize!, :load_tasks, :load_generators, :root, :to => :instance + delegate :call, + :initialize!, + :load_generators, + :load_tasks, + :middleware, + :root, + :to => :instance private :new def instance diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index 8c4247e840..31696598ce 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -76,7 +76,7 @@ module ApplicationTests end def middleware - AppTemplate::Application.instance.middleware.active.map(&:klass).map(&:name) + AppTemplate::Application.middleware.active.map(&:klass).map(&:name) end end end