Fix routing issues when navigating over tree, commits etc

This commit is contained in:
Dmitriy Zaporozhets 2012-12-25 06:14:05 +03:00
parent 49e73f8ac1
commit c8ba5c2d58
7 changed files with 44 additions and 5 deletions

View file

@ -102,7 +102,7 @@ class Project < ActiveRecord::Base
if id.include?("/")
id = id.split("/")
namespace_id = Namespace.find_by_path(id.first).id
where(namespace_id: namespace_id).find_by_path(id.last)
where(namespace_id: namespace_id).find_by_path(id.second)
else
where(path: id, namespace_id: nil).last
end