Commit 062f4040b92e4c9ce74e307463a62c6a3f62aeee

Authored by Andre Miras
1 parent 9eadae1568
Exists in master

adds subproject/netsted project support, refs #2

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

app/models/task_board_column.rb View file @ 062f404
... ... @@ -16,11 +16,12 @@
16 16  
17 17 def issues(order_column="project_weight")
18 18 @column_statuses = Hash.new
  19 + subproject_ids = project.self_and_descendants.collect {|p| p.id}.flatten
19 20 self.issue_statuses.order(:name).each do |status|
20 21 @column_statuses[status.id] = Array.new
21 22 issues = Issue.select("issues.*, tbi.is_archived, tbi.#{order_column} as weight, tbi.issue_id") \
22 23 .joins('LEFT OUTER JOIN task_board_issues AS tbi ON tbi.issue_id = issues.id') \
23   - .where("project_id = ? AND status_id = ? AND (is_archived IS NULL OR is_archived = 0)", self.project_id, status.id) \
  24 + .where("project_id IN (?) AND status_id = ? AND (is_archived IS NULL OR is_archived = FALSE)", subproject_ids, status.id) \
24 25 .order("weight ASC, created_on ASC")
25 26 issues.each do |issue|
26 27 # Create a TaskBoardIssue (i.e. a Card) if one doesn't exist already.