Merge pull request #2471 from basecamp/fix-crash-during-export
Fix crash during export
This commit is contained in:
@@ -67,7 +67,7 @@ module Card::Exportable
|
||||
end
|
||||
|
||||
def collect_attachments
|
||||
attachments.to_a + comments.flat_map { |c| c.attachments.to_a }
|
||||
(attachments.to_a + comments.flat_map { |c| c.attachments.to_a }).uniq(&:blob_id)
|
||||
end
|
||||
|
||||
def export_status
|
||||
|
||||
@@ -44,7 +44,12 @@ class ZipFile
|
||||
# ActiveStorage's upload method expects a read-based IO, but ZipKit
|
||||
# needs a write-based stream. The TransferManager's upload_stream
|
||||
# yields a writable IO that we can stream directly to.
|
||||
service.send(:upload_stream, key: blob.key, part_size: 100.megabytes) do |write_stream|
|
||||
service.send(:upload_stream,
|
||||
key: blob.key,
|
||||
content_type: "application/zip",
|
||||
part_size: 100.megabytes,
|
||||
**service.upload_options
|
||||
) do |write_stream|
|
||||
write_stream.binmode
|
||||
writer.stream_to(write_stream)
|
||||
yield writer
|
||||
|
||||
Reference in New Issue
Block a user