[Fix #2697] When file does not exist on openstack do not crash

This commit is contained in:
Mathieu Magnin 2018-10-31 15:20:45 +01:00
parent 77275bb52b
commit 917b271a7f

View file

@ -2,4 +2,12 @@ class BaseUploader < CarrierWave::Uploader::Base
def cache_dir
Rails.application.secrets.carrierwave[:cache_dir]
end
# https://github.com/carrierwaveuploader/carrierwave/wiki/how-to:-silently-ignore-missing-files-on-destroy-or-overwrite
def remove!
begin
super
rescue Fog::Storage::OpenStack::NotFound
end
end
end