]> source.dussan.org Git - redmine.git/commitdiff
Preload journal's user (#6375).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 5 Mar 2017 15:16:24 +0000 (15:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 5 Mar 2017 15:16:24 +0000 (15:16 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16377 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index d8dce76b4e694e38f05870535c41993705ffc9f1..d96f61e15bccb3fd8f9afd4cfffb566374ba26bc 100644 (file)
@@ -1160,7 +1160,7 @@ class Issue < ActiveRecord::Base
         group(:journalized_id).
         maximum(:id).
         values
-      journals = Journal.where(:id => journal_ids).to_a
+      journals = Journal.where(:id => journal_ids).preload(:user).to_a
 
       issues.each do |issue|
         journal = journals.detect {|j| j.journalized_id == issue.id}