diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/inspector.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb index 115ec98ea9..b806ee015b 100644 --- a/actionpack/lib/action_dispatch/routing/inspector.rb +++ b/actionpack/lib/action_dispatch/routing/inspector.rb @@ -60,8 +60,7 @@ module ActionDispatch end def format(formatter, filter = nil) - filter_options = normalize_filter(filter) - routes_to_display = filter_routes(filter_options) + routes_to_display = filter_routes(normalize_filter(filter)) routes = collect_routes(routes_to_display) if routes.none? formatter.no_routes(collect_routes(@routes)) @@ -89,10 +88,10 @@ module ActionDispatch end end - def filter_routes(filter_options) - if filter_options + def filter_routes(filter) + if filter @routes.select do |route| - filter_options.any? { |default, filter| route.defaults[default] =~ filter } + filter.any? { |default, value| route.defaults[default] =~ value } end else @routes |