summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-09-26 18:13:31 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-09-26 18:13:31 +0000
commit83e0be5d07de590e35f30b81c5870ce02746e6b7 (patch)
tree82869968ef685eecc417012457dc3d0ea18f693d /app/models
parent76fcf136d0fa3b5d0e87bdc6ac91e0d6f80463e5 (diff)
downloadredmine-83e0be5d07de590e35f30b81c5870ce02746e6b7.tar.gz
redmine-83e0be5d07de590e35f30b81c5870ce02746e6b7.zip
Fixes reverting an issue to a status with a done_ratio of 0%. #5170
Contributed by Felix Schäfer git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4186 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index c49952306..b72d7b4ad 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -263,7 +263,7 @@ class Issue < ActiveRecord::Base
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
status.default_done_ratio
else
read_attribute(:done_ratio)
@@ -326,7 +326,7 @@ class Issue < ActiveRecord::Base
# Set the done_ratio using the status if that setting is set. This will keep the done_ratios
# even if the user turns off the setting later
def update_done_ratio_from_issue_status
- if Issue.use_status_for_done_ratio? && status && status.default_done_ratio?
+ if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
self.done_ratio = status.default_done_ratio
end
end
@@ -714,7 +714,7 @@ class Issue < ActiveRecord::Base
end
# done ratio = weighted average ratio of leaves
- unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio?
+ 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