mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Block accidental serialization of entire AR models (#27668)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user