Actions
Defect #6310
closeddone ratio is not correct in one of the situations
Start date:
2010-09-06
Due date:
% Done:
0%
Estimated time:
Resolution:
Duplicate
Affected version:
Description
I noticed that done ratio is not correct in the situation.
Setting of Calculate the issue done ratio with: "Use the issue status".
Status %Done New 0 In Progress 10
1. Create issue with "New" status, then done ratio is 0%.
2. Change issue status to "In Progress", then done ratio is 10%.
3. Change back issue status to "New", then done ratio is NOT 0% but 10%.
4. On [Administration] -> [Issue Statuses], execute "Update issue done ratios", then done ration is 0%.
This is why IssueStatus#default_done_ratio? method returns false when default_done_ratio is ZERO.
I checked it trunk head and tags 1.0.1.
% ruby script/console
Loading development environment (Rails 2.3.5)
>> IssueStatus.find_by_name("New").default_done_ratio?
=> false
>> IssueStatus.find_by_name("In Progress").default_done_ratio?
=> true
A simple patch is below.
% svn diff
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb (revision xxx)
+++ app/models/issue.rb (working copy)
@@ -245,7 +245,7 @@
end
def done_ratio
- if Issue.use_status_for_done_ratio? && status && status.default_done_ratio?
+ if Issue.use_status_for_done_ratio? && status && !status.default_done_ratio.nil?
status.default_done_ratio
else
read_attribute(:done_ratio)
Thank you.
Kiwamu Kato
Related issues
Actions