DEV: Block accidental serialization of entire AR models (#27668)

This commit is contained in:
Jan Cernik
2024-07-01 17:08:48 -03:00
committed by GitHub
parent 1ae902fa60
commit 6599b85a75
19 changed files with 98 additions and 45 deletions

View File

@@ -113,6 +113,12 @@ module ChatSpecHelpers
end
def create_draft(channel, thread: nil, user: Discourse.system_user, data: { message: "draft" })
if data[:uploads]
data[:uploads] = data[:uploads].map do |upload|
UploadSerializer.new(upload, root: false).as_json
end
end
result =
::Chat::UpsertDraft.call(
guardian: user.guardian,