[#2180] Handle additionnal wrapping layer in production

This commit is contained in:
Frederic Merizen 2019-03-28 15:47:29 +01:00 committed by Pierre de La Morinerie
parent f194291e54
commit 4d021f1d85

View file

@ -17,6 +17,11 @@ class CarrierwaveActiveStorageMigrationService
def active_storage_openstack_client! def active_storage_openstack_client!
service = ActiveStorage::Blob.service service = ActiveStorage::Blob.service
if defined?(ActiveStorage::Service::DsProxyService) &&
service.is_a?(ActiveStorage::Service::DsProxyService)
service = service.wrapped
end
if !defined?(ActiveStorage::Service::OpenStackService) || if !defined?(ActiveStorage::Service::OpenStackService) ||
!service.is_a?(ActiveStorage::Service::OpenStackService) !service.is_a?(ActiveStorage::Service::OpenStackService)
raise StandardError, 'ActiveStorage must be backed by OpenStack' raise StandardError, 'ActiveStorage must be backed by OpenStack'