diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-03-02 11:01:07 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-03-02 11:01:07 -0800 |
commit | 37654d12ae95f751a91167a68bfb8d1bfd168d9c (patch) | |
tree | a02bba3f074f7eba21ceaa61873098fa4e2525bb /railties/lib | |
parent | a8a361cf80e145973ca5b19551a206f933d60c60 (diff) | |
download | rails-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.rb | 2 |
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 |