Defect #5170 » issue.rb.diff
app/models/issue.rb (作業コピー) | ||
---|---|---|
244 | 244 |
end |
245 | 245 |
|
246 | 246 |
def done_ratio |
247 |
if Issue.use_status_for_done_ratio? && status && status.default_done_ratio?
|
|
247 |
if Issue.use_status_for_done_ratio? && status && status.default_done_ratio |
|
248 | 248 |
status.default_done_ratio |
249 | 249 |
else |
250 | 250 |
read_attribute(:done_ratio) |
... | ... | |
307 | 307 |
# Set the done_ratio using the status if that setting is set. This will keep the done_ratios |
308 | 308 |
# even if the user turns off the setting later |
309 | 309 |
def update_done_ratio_from_issue_status |
310 |
if Issue.use_status_for_done_ratio? && status && status.default_done_ratio?
|
|
310 |
if Issue.use_status_for_done_ratio? && status && status.default_done_ratio |
|
311 | 311 |
self.done_ratio = status.default_done_ratio |
312 | 312 |
end |
313 | 313 |
end |
... | ... | |
652 | 652 |
end |
653 | 653 |
|
654 | 654 |
# done ratio = weighted average ratio of leaves |
655 |
unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio?
|
|
655 |
unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio |
|
656 | 656 |
leaves_count = p.leaves.count |
657 | 657 |
if leaves_count > 0 |
658 | 658 |
average = p.leaves.average(:estimated_hours).to_f |