Merge pull request #185 from themgt/patch-1

should sort by Page#depth so slug parts are in the right order
This commit is contained in:
Didier Lafforgue 2011-08-30 15:11:46 -07:00
commit 761a64b130

View File

@ -69,7 +69,7 @@ class Page
if self.index? || self.not_found?
self.slug
else
slugs = self.self_and_ancestors.map(&:slug)
slugs = self.self_and_ancestors.sort_by(&:depth).map(&:slug)
slugs.shift unless slugs.size == 1
File.join slugs
end