diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/wiki_page.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 909da4316d0..cd4c7895587 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -31,7 +31,9 @@ class WikiPage pages.each_with_object([]) do |page, grouped_pages| next grouped_pages << page unless page.directory.present? - directory = grouped_pages.find { |dir| dir.slug == page.directory } + directory = grouped_pages.find do |obj| + obj.is_a?(WikiDirectory) && obj.slug == page.directory + end next directory.pages << page if directory |