summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-01-16 09:00:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-01-16 09:00:37 +0000
commitf4b2b7e7fb133d5b6beec9315cd456ba83a5fc79 (patch)
treeda7434a105c7d57708ed25b22c3ae10dd7a759d4 /app
parentb3663ee5c4bf093234d90ef81ea788d9433914ee (diff)
downloadredmine-f4b2b7e7fb133d5b6beec9315cd456ba83a5fc79.tar.gz
redmine-f4b2b7e7fb133d5b6beec9315cd456ba83a5fc79.zip
Only consider open subtasks when computing the priority of a parent issue (#5880).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@15064 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 00a122c1b..cf9faaf33 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1451,9 +1451,11 @@ class Issue < ActiveRecord::Base
def recalculate_attributes_for(issue_id)
if issue_id && p = Issue.find_by_id(issue_id)
if p.priority_derived?
- # priority = highest priority of children
- if priority_position = p.children.joins(:priority).maximum("#{IssuePriority.table_name}.position")
+ # priority = highest priority of open children
+ if priority_position = p.children.open.joins(:priority).maximum("#{IssuePriority.table_name}.position")
p.priority = IssuePriority.find_by_position(priority_position)
+ else
+ p.priority = IssuePriority.default
end
end