chore: Delayed deploy of direct uploads (#3966)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Tejaswini Chile
2022-02-15 16:16:54 +05:30
committed by GitHub
parent 2591a04c0b
commit 94a473c9f8
12 changed files with 90 additions and 40 deletions

View File

@@ -29,10 +29,12 @@ class Messages::MessageBuilder
return if @attachments.blank?
@attachments.each do |uploaded_attachment|
@message.attachments.build(
attachment = @message.attachments.build(
account_id: @message.account_id,
file: uploaded_attachment
)
attachment.file_type = file_type(uploaded_attachment&.content_type) if uploaded_attachment.is_a?(ActionDispatch::Http::UploadedFile)
end
end