Improve WikiPage.group_by_directory
This commit is contained in:
parent
d2b3fe45af
commit
389bd6b735
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue