FIX: don't include multisite upload path to source URL if already exist.

This commit is contained in:
Vinoth Kannan 2019-08-02 07:57:27 +05:30
parent a1fc35fdf7
commit 3e456d5c0b

View File

@ -71,7 +71,9 @@ class S3Helper
if !Rails.configuration.multisite
options[:copy_source] = File.join(@s3_bucket_name, source)
else
if @s3_bucket_folder_path
if source.include?(multisite_upload_path) || source.include?(@tombstone_prefix)
options[:copy_source] = File.join(@s3_bucket_name, source)
elsif @s3_bucket_folder_path
folder, filename = begin
source.split("/".freeze, 2)
end