Commit 904aa039 authored by Alex Braha Stoll's avatar Alex Braha Stoll

Change WikiPage.group_by_directory to use WikiPage#directory

parent 5bbe6559
...@@ -17,10 +17,8 @@ class WikiPage ...@@ -17,10 +17,8 @@ class WikiPage
directories = { '/' => [] } directories = { '/' => [] }
pages.each do |page| pages.each do |page|
directory = page.wiki.page_title_and_dir(page.slug).last directories[page.directory] ||= []
directory = '/' if directory.blank? directories[page.directory] << page
directories[directory] ||= []
directories[directory] << page
end end
directories directories
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment