Patch #43934 ยป 0001-Optimize-Issue-visible_journals_with_index-preload-b.patch
| 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
|
||