1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-01 03:57:15 +00:00

Preload tracker when retrieving journal events to improve Activity view performance (#42077).

Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23447 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2025-01-18 05:37:55 +00:00
parent cf4a72d3f5
commit 0dcc20eed3

View File

@ -53,7 +53,7 @@ class Journal < ApplicationRecord
:author_key => :user_id,
:scope =>
proc do
preload({:issue => :project}, :user).
preload({:issue => :project}, {:issue => :tracker}, :user).
joins("LEFT OUTER JOIN #{JournalDetail.table_name} ON #{JournalDetail.table_name}.journal_id = #{Journal.table_name}.id").
where("#{Journal.table_name}.journalized_type = 'Issue' AND" +
" (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')").distinct