Ignore archived subprojects in Project#rolled_up_trackers (#2550).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2311 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-01-25 11:15:28 +00:00
parent 97e31c4026
commit 90c742e4f1
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -225,12 +225,12 @@ class Project < ActiveRecord::Base
end
end
# Returns an array of the trackers used by the project and its sub projects
# Returns an array of the trackers used by the project and its active sub projects
def rolled_up_trackers
@rolled_up_trackers ||=
Tracker.find(:all, :include => :projects,
:select => "DISTINCT #{Tracker.table_name}.*",
:conditions => ["#{Project.table_name}.lft >= ? AND #{Project.table_name}.rgt <= ?", lft, rgt],
:conditions => ["#{Project.table_name}.lft >= ? AND #{Project.table_name}.rgt <= ? AND #{Project.table_name}.status = #{STATUS_ACTIVE}", lft, rgt],
:order => "#{Tracker.table_name}.position")
end