From 37654d12ae95f751a91167a68bfb8d1bfd168d9c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 2 Mar 2015 11:01:07 -0800 Subject: ask the routes objects for its Rack env key this centralizes the logic for determining the script name key and drops object allocations when calling `engine_script_name` (which is called on each `url_for`). --- railties/lib/rails/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index e1d5caf790..fd37fd0457 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -513,7 +513,7 @@ module Rails def call(env) env.merge!(env_config) if env['SCRIPT_NAME'] - env["ROUTES_#{routes.object_id}_SCRIPT_NAME"] = env['SCRIPT_NAME'].dup + env[routes.env_key] = env['SCRIPT_NAME'].dup end app.call(env) end -- cgit v1.2.3