Skip to content

Commit

Permalink
Avoid N+1 queries by preloading associations
Browse files Browse the repository at this point in the history
  • Loading branch information
nanego committed Oct 28, 2024
1 parent 66edc85 commit d04869c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/redmine_comments/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module RedmineComments::IssuePatch
# Used to display the issue history
def visible_journals_with_index(user = User.current)
result = journals.
includes(:functions, :roles).
preload(:details).
preload(:user => :email_address).
reorder(:created_on, :id).to_a
Expand Down

0 comments on commit d04869c

Please sign in to comment.