summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-02-06 18:00:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-02-06 18:00:37 +0000
commitb8ffc995c187fff2f4434d17f6141190c048b0a5 (patch)
treeea074658cdfcd536a921b7f309cf2e2f2dd5fa20 /app/models/issue.rb
parentf52253c2ef47c8b9693a92fcb78a5271cfc2ffd8 (diff)
downloadredmine-b8ffc995c187fff2f4434d17f6141190c048b0a5.tar.gz
redmine-b8ffc995c187fff2f4434d17f6141190c048b0a5.zip
Merged r12745 (#15870).
git-svn-id: http://svn.redmine.org/redmine/branches/2.4-stable@12847 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 0101abf00..582caaa60 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1352,7 +1352,7 @@ class Issue < ActiveRecord::Base
unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
leaves_count = p.leaves.count
if leaves_count > 0
- average = p.leaves.average(:estimated_hours).to_f
+ average = p.leaves.where("estimated_hours > 0").average(:estimated_hours).to_f
if average == 0
average = 1
end