aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-03-02 11:01:07 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2015-03-02 11:01:07 -0800
commit37654d12ae95f751a91167a68bfb8d1bfd168d9c (patch)
treea02bba3f074f7eba21ceaa61873098fa4e2525bb /railties/lib
parenta8a361cf80e145973ca5b19551a206f933d60c60 (diff)
downloadrails-37654d12ae95f751a91167a68bfb8d1bfd168d9c.tar.gz
rails-37654d12ae95f751a91167a68bfb8d1bfd168d9c.tar.bz2
rails-37654d12ae95f751a91167a68bfb8d1bfd168d9c.zip
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`).
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/engine.rb2
1 files changed, 1 insertions, 1 deletions
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