From 4d021f1d853c3ec2c560608a646f581bfd3e71df Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Thu, 28 Mar 2019 15:47:29 +0100 Subject: [PATCH] [#2180] Handle additionnal wrapping layer in production --- app/services/carrierwave_active_storage_migration_service.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/services/carrierwave_active_storage_migration_service.rb b/app/services/carrierwave_active_storage_migration_service.rb index c9fd7df86..640643042 100644 --- a/app/services/carrierwave_active_storage_migration_service.rb +++ b/app/services/carrierwave_active_storage_migration_service.rb @@ -17,6 +17,11 @@ class CarrierwaveActiveStorageMigrationService def active_storage_openstack_client! service = ActiveStorage::Blob.service + if defined?(ActiveStorage::Service::DsProxyService) && + service.is_a?(ActiveStorage::Service::DsProxyService) + service = service.wrapped + end + if !defined?(ActiveStorage::Service::OpenStackService) || !service.is_a?(ActiveStorage::Service::OpenStackService) raise StandardError, 'ActiveStorage must be backed by OpenStack'