1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Delete MiniMagick tempfile when transformation fails

This commit is contained in:
George Claghorn 2017-12-18 22:01:48 -05:00
parent d9e4bffb60
commit 2df99f8bc5

View file

@ -104,7 +104,13 @@ class ActiveStorage::Variant
def open_image(&block)
download_image.tap(&block).destroy!
image = download_image
begin
yield image
ensure
image.destroy!
end
end
def download_image