]> source.dussan.org Git - redmine.git/commitdiff
TimeEntry acts_as_activity_provider scope should joins(:project) (#18818).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Feb 2015 09:10:57 +0000 (09:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Feb 2015 09:10:57 +0000 (09:10 +0000)
Patch by OndÅ™ej Ezr.

git-svn-id: http://svn.redmine.org/redmine/trunk@13971 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/time_entry.rb

index 2445a33577340d80adecd74660e250966cc9972b..f66fbc78a2fbd16cfee0ed8f175bee3a6f79d078 100644 (file)
@@ -35,7 +35,7 @@ class TimeEntry < ActiveRecord::Base
 
   acts_as_activity_provider :timestamp => "#{table_name}.created_on",
                             :author_key => :user_id,
-                            :scope => preload(:project)
+                            :scope => joins(:project).preload(:project)
 
   validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
   validates_numericality_of :hours, :allow_nil => true, :message => :invalid