mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 23:32:33 -05:00
refactor and fixes
This commit is contained in:
1 parent
3b745a650d
commit
47c57158f4
17 files changed
+168
-84
No files matched your search
@@ -11,4 +11,21 @@ module Submitters
|
||||
is_more_than_two_images && original_documents.find { |a| a.uuid == attachment.uuid }&.image?
|
||||
end
|
||||
end
|
||||
|
||||
def create_attachment!(submitter, params)
|
||||
blob =
|
||||
if (file = params[:file])
|
||||
ActiveStorage::Blob.create_and_upload!(io: file.open,
|
||||
filename: file.original_filename,
|
||||
content_type: file.content_type)
|
||||
else
|
||||
ActiveStorage::Blob.find_signed(params[:blob_signed_id])
|
||||
end
|
||||
|
||||
ActiveStorage::Attachment.create!(
|
||||
blob:,
|
||||
name: params[:name],
|
||||
record: submitter
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user