From 6f1cda4852fdf04be23e77825ffcdb1a22b913a7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 19 Jan 2014 08:35:59 +0000 Subject: [PATCH] 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 --- app/models/issue.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/issue.rb b/app/models/issue.rb index 6cfe97927..fec0568e3 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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 -- 2.39.5