Use :joins instead of :include.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8982 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-24 18:55:09 +00:00
parent cc19635b6e
commit d04b4aafb6
1 changed files with 1 additions and 1 deletions

View File

@ -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?