Make sure that we don't set the done ratio to a value > 100% (#15870).

git-svn-id: http://svn.redmine.org/redmine/trunk@12669 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2014-01-19 08:35:59 +00:00
parent 364b334d89
commit 6f1cda4852
1 changed files with 1 additions and 0 deletions

View File

@ -1364,6 +1364,7 @@ class Issue < ActiveRecord::Base
"* (CASE WHEN is_closed = #{connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)").to_f
progress = done / (average * leaves_count)
p.done_ratio = progress.round
p.done_ratio = 100 if p.done_ratio > 100
end
end