]> source.dussan.org Git - redmine.git/commitdiff
Use :joins instead of :include.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 24 Feb 2012 18:55:09 +0000 (18:55 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 24 Feb 2012 18:55:09 +0000 (18:55 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8982 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/version.rb

index 08463976bbc4089fdb6e45fd3ab68cca6f9fafe8..012168a8c3d56f38bf4d058a9bf3ce88c10355d3 100644 (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?