You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing out all three ways of calling copy_to ({Aws::S3::Object}, Hash - with :bucket and :key, String - formatted like "target-bucket-name/target-key") with an additional argument of acl: "public-read".
It seems like copy_to with acl: "public-read" works when passing in an {Aws::S3::Object} and a String with the bucket name and target key. However, passing in options like (bucket: 'test-bucket', key: 'test-key', acl: "public-read") doesn't work because the method below bundles up the arguments into the target parameter and options stays empty.
def copy_to(target, options = {})
ObjectCopier.new(self, options).copy_to(target, options)
end
The method works if we pass in two hashes ({bucket: 'test-bucket', key: 'test-key'}, {acl: "public-read"}) and I was wondering if that was the intended way of calling this method since I couldn't find anything in the documentation.
Thank you for your time!
The text was updated successfully, but these errors were encountered:
The documented method signature is #copy_from(source, options = {}). The source param can be a String, Hash, or Aws::S3::Object. Yes, the implementation required you to pass two hashes if source was a hash.
I went ahead and added the ability to merge the options into the source/target hash.
Hi,
I was testing out all three ways of calling
copy_to
({Aws::S3::Object}, Hash - with:bucket
and:key
, String - formatted like"target-bucket-name/target-key"
) with an additional argument ofacl: "public-read"
.It seems like
copy_to
withacl: "public-read"
works when passing in an{Aws::S3::Object}
and a String with the bucket name and target key. However, passing in options like(bucket: 'test-bucket', key: 'test-key', acl: "public-read")
doesn't work because the method below bundles up the arguments into thetarget
parameter andoptions
stays empty.The method works if we pass in two hashes
({bucket: 'test-bucket', key: 'test-key'}, {acl: "public-read"})
and I was wondering if that was the intended way of calling this method since I couldn't find anything in the documentation.Thank you for your time!
The text was updated successfully, but these errors were encountered: