Project

General

Profile

Patch #43934 ยป 0001-Optimize-Issue-visible_journals_with_index-preload-b.patch

Go MAEDA, 2026-04-07 04:21

View differences:

app/models/issue.rb
# Returns the journals that are visible to user with their index
# Used to display the issue history
def visible_journals_with_index(user=User.current)
preloads = [:details, :updated_by]
preloads << (Setting.gravatar_enabled? ? {user: :email_address} : :user)
result = journals.
preload(:details).
preload(:user => :email_address).
preload(*preloads).
reorder(:created_on, :id).
to_a
    (1-1/1)