Merge pull request #1433 from okriuchykhin/ok_SCI_2864

Additional fix for export all S3 path [SCI-2864]
This commit is contained in:
Luka Murn 2018-12-20 13:27:50 +01:00 committed by GitHub
commit 1c8407e4f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,8 +9,13 @@ class TeamZipExport < ZipExport
# Override path only for S3
if ENV['PAPERCLIP_STORAGE'] == 's3'
s3_path = '/zip_exports/:attachment/:id_partition/:hash/:style/:filename'
s3_path.prepend("/#{ENV['S3_SUBFOLDER']}") if ENV['S3_SUBFOLDER']
s3_path =
if ENV['S3_SUBFOLDER']
"/#{ENV['S3_SUBFOLDER']}/zip_exports/:attachment/"\
":id_partition/:hash/:style/:filename"
else
'/zip_exports/:attachment/:id_partition/:hash/:style/:filename'
end
has_attached_file :zip_file, path: s3_path
validates_attachment :zip_file,