From d04b4aafb642f4570679785f7e36cf68e85aab9b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 24 Feb 2012 18:55:09 +0000 Subject: [PATCH] Use :joins instead of :include. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8982 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/version.rb b/app/models/version.rb index 08463976b..012168a8c 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -68,7 +68,7 @@ class Version < ActiveRecord::Base # Returns the total reported time for this version def spent_hours - @spent_hours ||= TimeEntry.sum(:hours, :include => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f + @spent_hours ||= TimeEntry.sum(:hours, :joins => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f end def closed?