aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/service
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-08-03 22:41:19 -0400
committerGeorge Claghorn <george@basecamp.com>2018-08-03 22:41:19 -0400
commitbd680dd59a6274cf566930241783d83ce44c879d (patch)
tree87278c74ae3750b5fd908f0a703a42a3bf3da279 /activestorage/lib/active_storage/service
parenta69394e9fd7ef826bdd35f10f054405ecd6760cf (diff)
downloadrails-bd680dd59a6274cf566930241783d83ce44c879d.tar.gz
rails-bd680dd59a6274cf566930241783d83ce44c879d.tar.bz2
rails-bd680dd59a6274cf566930241783d83ce44c879d.zip
Fix uploading Tempfiles to Azure Storage
Closes #32530.
Diffstat (limited to 'activestorage/lib/active_storage/service')
-rw-r--r--activestorage/lib/active_storage/service/azure_storage_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/lib/active_storage/service/azure_storage_service.rb b/activestorage/lib/active_storage/service/azure_storage_service.rb
index 2867a4e441..b26234c722 100644
--- a/activestorage/lib/active_storage/service/azure_storage_service.rb
+++ b/activestorage/lib/active_storage/service/azure_storage_service.rb
@@ -20,7 +20,7 @@ module ActiveStorage
def upload(key, io, checksum: nil)
instrument :upload, key: key, checksum: checksum do
begin
- blobs.create_block_blob(container, key, io, content_md5: checksum)
+ blobs.create_block_blob(container, key, IO.try_convert(io) || io, content_md5: checksum)
rescue Azure::Core::Http::HTTPError
raise ActiveStorage::IntegrityError
end