Rails3.1 compatibility

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8275 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-12-18 08:21:29 +00:00
parent 2cf2f4964c
commit 3717ff34af
1 changed files with 2 additions and 1 deletions

View File

@ -522,7 +522,8 @@ class Issue < ActiveRecord::Base
# spent_hours => 0.0
# spent_hours => 50.2
def total_spent_hours
@total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours", :include => :time_entries).to_f || 0.0
@total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours",
:joins => "LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").to_f || 0.0
end
def relations