From: Jean-Philippe Lang Date: Sun, 5 Mar 2017 15:16:24 +0000 (+0000) Subject: Preload journal's user (#6375). X-Git-Tag: 3.4.0~262 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=29ad5b31e0721cb0194ef019289dba265e116f45;p=redmine.git Preload journal's user (#6375). git-svn-id: http://svn.redmine.org/redmine/trunk@16377 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/issue.rb b/app/models/issue.rb index d8dce76b4..d96f61e15 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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}