]> source.dussan.org Git - redmine.git/commitdiff
Issue#done_ratio should not break if status is nil.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Dec 2009 11:02:53 +0000 (11:02 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Dec 2009 11:02:53 +0000 (11:02 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3159 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index c0cdac86ea87f6d6ef67fd09d3bfe4627d7ab3f3..a550779cd7ef0a95a0907e84659d0c7e3191a8a5 100644 (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