summaryrefslogtreecommitdiffstats
path: root/app/models/version.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-04-11 13:20:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-04-11 13:20:02 +0000
commit71a4158fd0494e47e52ec701f7d40f5ae068f811 (patch)
tree6211d9b4bd6524f678f33429300771d6e0cc813a /app/models/version.rb
parent58792737394c59ecac08db2cea0eeebb836f160a (diff)
downloadredmine-71a4158fd0494e47e52ec701f7d40f5ae068f811.tar.gz
redmine-71a4158fd0494e47e52ec701f7d40f5ae068f811.zip
Fixes calculation of version estimated hours with subtasks (#5265).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3633 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/version.rb')
-rw-r--r--app/models/version.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/version.rb b/app/models/version.rb
index bc0e17e22..f9b48fb11 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -52,8 +52,9 @@ class Version < ActiveRecord::Base
end
# Returns the total estimated time for this version
+ # (sum of leaves estimated_hours)
def estimated_hours
- @estimated_hours ||= fixed_issues.sum(:estimated_hours).to_f
+ @estimated_hours ||= fixed_issues.leaves.sum(:estimated_hours).to_f
end
# Returns the total reported time for this version