]> source.dussan.org Git - redmine.git/commitdiff
Fixed Version#issues_progress for Rails 3.1.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 25 Feb 2012 00:07:09 +0000 (00:07 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 25 Feb 2012 00:07:09 +0000 (00:07 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8986 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/version.rb

index 012168a8c3d56f38bf4d058a9bf3ce88c10355d3..24048a242e9f4ec0150fc19ece45315b16191075 100644 (file)
@@ -233,8 +233,8 @@ class Version < ActiveRecord::Base
         ratio = open ? 'done_ratio' : 100
 
         done = fixed_issues.sum("COALESCE(estimated_hours, #{estimated_average}) * #{ratio}",
-                                  :include => :status,
-                                  :conditions => ["is_closed = ?", !open]).to_f
+                                  :joins => :status,
+                                  :conditions => ["#{IssueStatus.table_name}.is_closed = ?", !open]).to_f
         progress = done / (estimated_average * issues_count)
       end
       progress