resolve/refinerycms — pull request #1586 by nicholassm (2012-04-10 12:52:33+00:00)
Title: Fixes page ambiguity for different pages with the same slug in find_by_path.

[Same pull-request as the one that's already merged into the master branch.]

The first page found in `Refinery::Page.find_by_path` should be a root page.

The current version could return the wrong page in the following scenario:

/about # page 1
/team/about # page 2

The problem is that
`Refinery::Page.find_by_path("about")`
and
`Refinery::Page.find_by_path("team/about")`
could return page 2 in both cases depending on the ordering of the pages in the database.
This commit fixes this issue by requiring the first page found `by_slug` to be a root page.