Merge pull request #2006 from okriuchykhin/ok_SCI_3765

Add path method to custom ActiveStorage S3 service [SCI-3765]
This commit is contained in:
Alex Kriuchykhin 2019-09-12 15:34:03 +02:00 committed by GitHub
commit 0d6f011e61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,6 +123,10 @@ module ActiveStorage
{ 'Content-Type' => content_type, 'Content-MD5' => checksum } { 'Content-Type' => content_type, 'Content-MD5' => checksum }
end end
def path_for(key)
subfolder.present? ? File.join(subfolder, key) : key
end
private private
MAXIMUM_UPLOAD_PARTS_COUNT = 10000 MAXIMUM_UPLOAD_PARTS_COUNT = 10000