mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 12:43:06 +08:00
Merge pull request #1432 from okriuchykhin/ok_SCI_2864
Fix S3 zip exports path [SCI-2864]
This commit is contained in:
commit
faf6601962
1 changed files with 4 additions and 3 deletions
|
@ -9,9 +9,10 @@ class TeamZipExport < ZipExport
|
|||
|
||||
# Override path only for S3
|
||||
if ENV['PAPERCLIP_STORAGE'] == 's3'
|
||||
has_attached_file :zip_file,
|
||||
path: '/zip_exports/:attachment/:id_partition/' \
|
||||
':hash/:style/:filename'
|
||||
s3_path = '/zip_exports/:attachment/:id_partition/:hash/:style/:filename'
|
||||
s3_path.prepend("/#{ENV['S3_SUBFOLDER']}") if ENV['S3_SUBFOLDER']
|
||||
|
||||
has_attached_file :zip_file, path: s3_path
|
||||
validates_attachment :zip_file,
|
||||
content_type: { content_type: 'application/zip' }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue