From 89d97560e76fa3839a033ae09d7a00d894af7362 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 13 May 2014 12:07:01 -0700 Subject: calls with :host should still use the optimized path --- actionpack/lib/action_dispatch/routing/route_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch') 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 -- cgit v1.2.3