From a0613ad8a9773c76a9b0a256f7099fde35823674 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 5 Oct 2012 12:07:16 -0300 Subject: Revert "Use flat_map { } instead of map {}.flatten" This reverts commit abf8de85519141496a6773310964ec03f6106f3f. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]] --- actionpack/lib/action_dispatch/routing/inspector.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb index 178e2074bc..c18dc94d4f 100644 --- a/actionpack/lib/action_dispatch/routing/inspector.rb +++ b/actionpack/lib/action_dispatch/routing/inspector.rb @@ -102,9 +102,9 @@ module ActionDispatch end def formatted_routes_for_engines - @engines.flat_map do |name, routes| + @engines.map do |name, routes| ["\nRoutes for #{name}:"] + formatted_routes(routes) - end + end.flatten end def formatted_routes(routes) -- cgit v1.2.3