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:
parent
d9e4bffb60
commit
2df99f8bc5
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue