Code cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10888 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-11-27 22:16:33 +00:00
parent 9a270c46c0
commit c3817e620f
1 changed files with 1 additions and 3 deletions

View File

@ -269,9 +269,7 @@ class Version < ActiveRecord::Base
if issues_count > 0 if issues_count > 0
ratio = open ? 'done_ratio' : 100 ratio = open ? 'done_ratio' : 100
done = fixed_issues.sum("COALESCE(estimated_hours, #{estimated_average}) * #{ratio}", done = fixed_issues.open(open).sum("COALESCE(estimated_hours, #{estimated_average}) * #{ratio}").to_f
:joins => :status,
:conditions => ["#{IssueStatus.table_name}.is_closed = ?", !open]).to_f
progress = done / (estimated_average * issues_count) progress = done / (estimated_average * issues_count)
end end
progress progress