Add path method to custom ActiveStorage S3 service [SCI-3765]

This commit is contained in:
Oleksii Kriuchykhin 2019-08-21 14:33:28 +02:00
parent f94b8165dc
commit 2298ba4e4e

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