diff options
author | Go MAEDA <maeda@farend.jp> | 2020-06-14 06:58:03 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-06-14 06:58:03 +0000 |
commit | f9cec4a18a1689b326dced3eab406d8628101930 (patch) | |
tree | 6e1530888742b9673865e1948a70f34b8b1d3d87 /app | |
parent | 11ba2e2f010dc65f9cc6704a222f7c2220b3b4bf (diff) | |
download | redmine-f9cec4a18a1689b326dced3eab406d8628101930.tar.gz redmine-f9cec4a18a1689b326dced3eab406d8628101930.zip |
Merged r19818 from trunk to 4.1-stable (#33576).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19819 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 713acdfe2..b52225137 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1707,12 +1707,12 @@ class Issue < ActiveRecord::Base if children.any? child_with_total_estimated_hours = children.select {|c| c.total_estimated_hours.to_f > 0.0} if child_with_total_estimated_hours.any? - average = child_with_total_estimated_hours.map(&:total_estimated_hours).sum.to_f / child_with_total_estimated_hours.count + average = child_with_total_estimated_hours.map(&:total_estimated_hours).sum.to_d / child_with_total_estimated_hours.count else - average = 1.0 + average = 1.0.to_d end done = children.map {|c| - estimated = c.total_estimated_hours.to_f + estimated = (c.total_estimated_hours || 0.0).to_d estimated = average unless estimated > 0.0 ratio = c.closed? ? 100 : (c.done_ratio || 0) estimated * ratio |