Reload remote file the cacheds file is already removed

This commit is contained in:
Shinya Maeda 2018-05-25 17:27:18 +09:00
parent 50b68fc2ea
commit 39d804b151

View file

@ -15,6 +15,9 @@ module CarrierWave
begin
file_body = ::File.open(file_body.path) if file_body.closed? # Reopen if it's closed
file_body.read
rescue Errno::ENOENT
@file = nil # rubocop:disable Gitlab/ModuleWithInstanceVariables
file.body
ensure
file_body.close
end