Merge pull request #3700 from betagouv/frederic/fix_pj_migration_for_production_env

[#2180] Handle additionnal wrapping layer in production
This commit is contained in:
Pierre de La Morinerie 2019-03-28 16:06:57 +01:00 committed by GitHub
commit f05a052674
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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'