diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-01 22:15:21 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-01 22:15:21 +0100 |
commit | 84c3738c146c28790eeca99c1a20b2c6ba20e548 (patch) | |
tree | ff8101c2f5802c513b9c9f0510918d6b7c428641 /actionpack | |
parent | 5966b801ced62bdfcf1c8189bc068911db90ac13 (diff) | |
download | rails-84c3738c146c28790eeca99c1a20b2c6ba20e548.tar.gz rails-84c3738c146c28790eeca99c1a20b2c6ba20e548.tar.bz2 rails-84c3738c146c28790eeca99c1a20b2c6ba20e548.zip |
Converge on filter.
Some places were saying filter, while others said filter_options, spare the ambiguity
and use filter throughout.
This inlines a needless local variable and clarifies a route filter consists of defaults
and values to match against.
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 |