diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-03-05 20:21:27 +0200 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-03-13 11:58:52 +0200 |
commit | 304906f1bd4cd6f2831b6ae39a9ae54599d85569 (patch) | |
tree | e3c42dac0b1677b5aa88eaa733ff2d6b38bccf7b /railties/lib/rails/commands | |
parent | e78b1e5e615978a221b68530641101451ab83e68 (diff) | |
download | rails-304906f1bd4cd6f2831b6ae39a9ae54599d85569.tar.gz rails-304906f1bd4cd6f2831b6ae39a9ae54599d85569.tar.bz2 rails-304906f1bd4cd6f2831b6ae39a9ae54599d85569.zip |
Introduce `ActionDispatch::Routing::ConsoleFormatter::Base`
- Create `Base` and inherit `Sheet` and `Expanded` in order to
- prevent code duplication.
- Remove trailing "\n" for components of `Expanded`.
- There is no need for `Expanded#header` to return `@buffer` so return `nil` instead.
- Change `no_routes` message "No routes were found for this controller"
since if use `-g`, it sounds incorrect.
- Display `No routes were found for this controller.` if apply `-c`.
- Display `No routes were found for this grep pattern.` if apply `-g`.
Related to #32130
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/routes/routes_command.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/railties/lib/rails/commands/routes/routes_command.rb b/railties/lib/rails/commands/routes/routes_command.rb index c4f3717095..25ee65aeaa 100644 --- a/railties/lib/rails/commands/routes/routes_command.rb +++ b/railties/lib/rails/commands/routes/routes_command.rb @@ -36,13 +36,7 @@ module Rails private def routes_filter - if options.has_key?("controller") - { controller: options["controller"] } - elsif options.has_key?("grep_pattern") - options["grep_pattern"] - else - nil - end + options.symbolize_keys.slice(:controller, :grep_pattern) end end end |