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
directories = { '/' => [] }
pages.each do |page|
directory = page.wiki.page_title_and_dir(page.slug).last
directory = '/' if directory.blank?
directories[directory] ||= []
directories[directory] << page
directories[page.directory] ||= []
directories[page.directory] << page
end
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