Skip to content

Commit 89d9756

Browse files
committed
calls with :host should still use the optimized path
1 parent 4cc0767 commit 89d9756

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

actionpack/lib/action_dispatch/routing/route_set.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def self.create(route, options)
155155
end
156156

157157
def self.optimize_helper?(route)
158-
!route.glob? && route.requirements.except(:controller, :action).empty?
158+
!route.glob? && route.requirements.except(:controller, :action, :host).empty?
159159
end
160160

161161
class OptimizedUrlHelper < UrlHelper # :nodoc:
@@ -171,7 +171,7 @@ def initialize(route, options)
171171

172172
def call(t, args)
173173
if args.size == arg_size && !args.last.is_a?(Hash) && optimize_routes_generation?(t)
174-
options = @options.merge t.url_options
174+
options = t.url_options.merge @options
175175
options[:path] = optimized_helper(args)
176176
ActionDispatch::Http::URL.url_for(options)
177177
else

0 commit comments

Comments
 (0)