diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index c4d87ea3d99d0565360868e9c5ce936bf1d48b23..30e9e5634bf97e303e7b783fb1d4bb188de762f1 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -191,7 +191,7 @@ def define_url_helper(route, name, kind, options) selector = url_helper_name(name, kind) hash_access_method = hash_access_name(name, kind) - if optimize_helper?(kind, route) + if optimize_helper?(route) @module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1 remove_possible_method :#{selector} def #{selector}(*args) @@ -217,7 +217,7 @@ def #{selector}(*args) end # Clause check about when we need to generate an optimized helper. - def optimize_helper?(kind, route) #:nodoc: + def optimize_helper?(route) #:nodoc: route.ast.grep(Journey::Nodes::Star).empty? && route.requirements.except(:controller, :action).empty? end