Issue#done_ratio should not break if status is nil.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3159 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-12-12 11:02:53 +00:00
parent 008f35277e
commit 1f47d5856e
1 changed files with 2 additions and 2 deletions

View File

@ -166,8 +166,8 @@ class Issue < ActiveRecord::Base
end
def done_ratio
if Issue.use_status_for_done_ratio? && !self.status.default_done_ratio.blank?
self.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)
end