From 16e8768a9e1f83017556fae4026fd644d757168e Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sat, 22 Aug 2026 14:23:08 +0900 Subject: [PATCH] Preload the authors of the attachments of an issue (N+1) --- app/views/issues/show.api.rsb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/show.api.rsb b/app/views/issues/show.api.rsb index 3532d4b96..5e0b3a203 100644 --- a/app/views/issues/show.api.rsb +++ b/app/views/issues/show.api.rsb @@ -34,7 +34,7 @@ api.issue do render_api_issue_children(@issue, api) if include_in_api_response?('children') api.array :attachments do - @issue.attachments.each do |attachment| + @issue.attachments.preload(:author).each do |attachment| render_api_attachment(attachment, api) end end if include_in_api_response?('attachments') -- 2.55.0