Storage: add :azure to remaining callers (#26080)

This commit is contained in:
Misty De Méo 2023-07-27 07:13:45 -07:00 committed by GitHub
parent 6c3c5bbbc3
commit 12a6cf569e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class BackupsController < ApplicationController
def download
case Paperclip::Attachment.default_options[:storage]
when :s3
when :s3, :azure
redirect_to @backup.dump.expiring_url(10), allow_other_host: true
when :fog
if Paperclip::Attachment.default_options.dig(:fog_credentials, :openstack_temp_url_key).present?

View file

@ -76,6 +76,9 @@ class AttachmentBatch
when :fog
logger.debug { "Deleting #{attachment.path(style)}" }
attachment.directory.files.new(key: attachment.path(style)).destroy
when :azure
logger.debug { "Deleting #{attachment.path(style)}" }
attachment.destroy
end
end
end

View file

@ -85,7 +85,7 @@ class SuspendAccountService < BaseService
rescue Aws::S3::Errors::NotImplemented => e
Rails.logger.error "Error trying to change ACL on #{attachment.s3_object(style).key}: #{e.message}"
end
when :fog
when :fog, :azure
# Not supported
when :filesystem
begin

View file

@ -81,7 +81,7 @@ class UnsuspendAccountService < BaseService
rescue Aws::S3::Errors::NotImplemented => e
Rails.logger.error "Error trying to change ACL on #{attachment.s3_object(style).key}: #{e.message}"
end
when :fog
when :fog, :azure
# Not supported
when :filesystem
begin