From 9b5c0850778207998a5cb8e5fe5bde6599af81d5 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 11 Mar 2013 20:46:21 +0100 Subject: config.ru uses the effective Rack app We used to pass the Rails::Application subclass to #run. The Rails server then called #to_app to convert that class to the actual Rack application. if you surround `#run` with a call to `#map` the server no longer convertes the class to the instance and we end up with unnecessary delegation calls on every request. --- railties/lib/rails/commands/server.rb | 1 + railties/lib/rails/generators/rails/app/templates/config.ru | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index ddf45d196a..876d457359 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -42,6 +42,7 @@ module Rails set_environment end + # TODO: this is no longer required but we keep it for the moment to support older config.ru files. def app @app ||= begin app = super diff --git a/railties/lib/rails/generators/rails/app/templates/config.ru b/railties/lib/rails/generators/rails/app/templates/config.ru index fcfbc6b07a..5bc2a619e8 100644 --- a/railties/lib/rails/generators/rails/app/templates/config.ru +++ b/railties/lib/rails/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 %> +run Rails.application -- cgit v1.2.3