Merged r4087 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4146 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-20 04:05:50 +00:00
parent 7ad17f92b1
commit b5bbc93325
5 changed files with 65 additions and 15 deletions
+9
View File
@@ -449,6 +449,15 @@ class Project < ActiveRecord::Base
enabled_modules.clear
end
end
# Returns an array of projects that are in this project's hierarchy
#
# Example: parents, children, siblings
def hierarchy
parents = project.self_and_ancestors || []
descendants = project.descendants || []
project_hierarchy = parents | descendants # Set union
end
# Returns an auto-generated project identifier based on the last identifier used
def self.next_identifier