aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-13 12:07:01 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-13 12:07:13 -0700
commit89d97560e76fa3839a033ae09d7a00d894af7362 (patch)
treea86e33cd6dc0d960f1b64568f82e256461e91cb7 /actionpack
parent4cc0767ee5b24e0a505501584adf3f1d53993e18 (diff)
downloadrails-89d97560e76fa3839a033ae09d7a00d894af7362.tar.gz
rails-89d97560e76fa3839a033ae09d7a00d894af7362.tar.bz2
rails-89d97560e76fa3839a033ae09d7a00d894af7362.zip
calls with :host should still use the optimized path
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 220de8dd93..76d193244e 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -155,7 +155,7 @@ module ActionDispatch
end
def self.optimize_helper?(route)
- !route.glob? && route.requirements.except(:controller, :action).empty?
+ !route.glob? && route.requirements.except(:controller, :action, :host).empty?
end
class OptimizedUrlHelper < UrlHelper # :nodoc:
@@ -171,7 +171,7 @@ module ActionDispatch
def call(t, args)
if args.size == arg_size && !args.last.is_a?(Hash) && optimize_routes_generation?(t)
- options = @options.merge t.url_options
+ options = t.url_options.merge @options
options[:path] = optimized_helper(args)
ActionDispatch::Http::URL.url_for(options)
else