From acd731347c9df4ee0de06f35fb1b61021716a407 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 29 Aug 2011 16:17:18 +0300 Subject: [PATCH] should sort by Page#depth so slug parts are in the right order --- app/models/page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/page.rb b/app/models/page.rb index e0bca03e..733e3358 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -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