Skip to content

Commit

Permalink
Only path requirements are relevant to optimized urls
Browse files Browse the repository at this point in the history
The bit of URL generation that is optimized is the generation of
the path so things like :host, :port, etc. are irrelevant.
  • Loading branch information
pixeltrix committed May 15, 2014
1 parent ee8dc39 commit e8059f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/routing/route_set.rb
Expand Up @@ -157,7 +157,7 @@ def self.create(route, options)
end end


def self.optimize_helper?(route) def self.optimize_helper?(route)
!route.glob? && route.requirements.except(:controller, :action, :host).empty? !route.glob? && route.path.requirements.empty?
end end


class OptimizedUrlHelper < UrlHelper # :nodoc: class OptimizedUrlHelper < UrlHelper # :nodoc:
Expand Down

0 comments on commit e8059f5

Please sign in to comment.