Remove media attachment only when file was exist ()

This commit is contained in:
S.H 2023-06-26 23:38:19 +09:00 committed by GitHub
parent bcee25e36c
commit 2c6f88ad71

View file

@ -64,7 +64,7 @@ class AttachmentBatch
keys << attachment.style_name_as_path(style)
when :filesystem
logger.debug { "Deleting #{attachment.path(style)}" }
FileUtils.remove_file(attachment.path(style))
FileUtils.remove_file(attachment.path(style), true)
when :fog
logger.debug { "Deleting #{attachment.path(style)}" }
attachment.directory.files.new(key: attachment.path(style)).destroy