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:
parent
cc19635b6e
commit
d04b4aafb6
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue