Improve WikiPage.group_by_directory

This commit is contained in:
Alex Braha Stoll 2016-12-31 17:03:20 -02:00
parent d2b3fe45af
commit 389bd6b735
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class WikiPage
return [] if pages.blank?
pages.sort_by { |page| [page.directory, page.slug] }.
group_by { |page| page.directory }.
group_by(&:directory).
map do |dir, pages|
if dir.present?
WikiDirectory.new(dir, pages)