diff options
Diffstat (limited to 'activestorage/app/models/active_storage')
-rw-r--r-- | activestorage/app/models/active_storage/variant.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activestorage/app/models/active_storage/variant.rb b/activestorage/app/models/active_storage/variant.rb index ece99518be..bdcb5e6a41 100644 --- a/activestorage/app/models/active_storage/variant.rb +++ b/activestorage/app/models/active_storage/variant.rb @@ -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 |