Feature: Send attachments to widget user (#621)

This commit is contained in:
Nithin David Thomas
2020-03-22 15:54:36 +05:30
committed by GitHub
parent fe70843fae
commit f7e5f1fabf
16 changed files with 317 additions and 92 deletions

View File

@@ -7,10 +7,17 @@ class Messages::Outgoing::NormalBuilder
@conversation = conversation
@user = user
@fb_id = params[:fb_id]
@attachment = params[:attachment]
end
def perform
@message = @conversation.messages.create!(message_params)
@message = @conversation.messages.build(message_params)
if @attachment
@message.attachment = Attachment.new(account_id: message.account_id)
@message.attachment.file.attach(@attachment[:file])
end
@message.save
@message
end
private