From 14184b1b2e6d38db13497c37d8bcc07540c25f44 Mon Sep 17 00:00:00 2001 From: mmd-osm Date: Sun, 4 Aug 2024 21:49:07 +0200 Subject: [PATCH] Messages: avoid calling json.partial! in loop --- app/views/api/messages/inbox.json.jbuilder | 4 ++-- app/views/api/messages/outbox.json.jbuilder | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/api/messages/inbox.json.jbuilder b/app/views/api/messages/inbox.json.jbuilder index 524006ded..122a82495 100644 --- a/app/views/api/messages/inbox.json.jbuilder +++ b/app/views/api/messages/inbox.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" -json.messages(@messages) do |message| - json.partial! message +json.messages do + json.array! @messages, :partial => "message", :as => :message end diff --git a/app/views/api/messages/outbox.json.jbuilder b/app/views/api/messages/outbox.json.jbuilder index 524006ded..122a82495 100644 --- a/app/views/api/messages/outbox.json.jbuilder +++ b/app/views/api/messages/outbox.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" -json.messages(@messages) do |message| - json.partial! message +json.messages do + json.array! @messages, :partial => "message", :as => :message end -- 2.39.5