diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2017-09-10 12:22:10 +0900 |
---|---|---|
committer | George Claghorn <george.claghorn@gmail.com> | 2017-09-09 23:22:10 -0400 |
commit | 83bfe0758363328a2cc4da54c9f02c10a29d8149 (patch) | |
tree | b7797cb3625697de6d62280faac0f71c4ff8524c /activestorage/lib/active_storage | |
parent | c8d25e6bfe52bbe7a955aae03618c79d340e7abb (diff) | |
download | rails-83bfe0758363328a2cc4da54c9f02c10a29d8149.tar.gz rails-83bfe0758363328a2cc4da54c9f02c10a29d8149.tar.bz2 rails-83bfe0758363328a2cc4da54c9f02c10a29d8149.zip |
Use v3 of the AWS SDK
Diffstat (limited to 'activestorage/lib/active_storage')
-rw-r--r-- | activestorage/lib/active_storage/service/s3_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activestorage/lib/active_storage/service/s3_service.rb b/activestorage/lib/active_storage/service/s3_service.rb index e5d1e56e05..e074269353 100644 --- a/activestorage/lib/active_storage/service/s3_service.rb +++ b/activestorage/lib/active_storage/service/s3_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "aws-sdk" +require "aws-sdk-s3" require "active_support/core_ext/numeric/bytes" module ActiveStorage @@ -54,7 +54,7 @@ module ActiveStorage def url(key, expires_in:, filename:, disposition:, content_type:) instrument :url, key do |payload| - generated_url = object_for(key).presigned_url :get, expires_in: expires_in, + generated_url = object_for(key).presigned_url :get, expires_in: expires_in.to_i, response_content_disposition: disposition, response_content_type: content_type @@ -66,7 +66,7 @@ module ActiveStorage def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:) instrument :url, key do |payload| - generated_url = object_for(key).presigned_url :put, expires_in: expires_in, + generated_url = object_for(key).presigned_url :put, expires_in: expires_in.to_i, content_type: content_type, content_length: content_length, content_md5: checksum payload[:url] = generated_url |