diff options
author | George Claghorn <george.claghorn@gmail.com> | 2018-08-10 12:10:13 -0400 |
---|---|---|
committer | George Claghorn <george.claghorn@gmail.com> | 2018-08-10 12:42:14 -0400 |
commit | 697f4a93ad386f9fb7795f0ba68f815f16ebad0f (patch) | |
tree | 57576c80df328be9b910dade1b21faddf8798629 /activestorage/app/models/active_storage/variant.rb | |
parent | 924f44371697c5fe1509a749e1187ad2c9257ab9 (diff) | |
download | rails-697f4a93ad386f9fb7795f0ba68f815f16ebad0f.tar.gz rails-697f4a93ad386f9fb7795f0ba68f815f16ebad0f.tar.bz2 rails-697f4a93ad386f9fb7795f0ba68f815f16ebad0f.zip |
Extract transformers
Diffstat (limited to 'activestorage/app/models/active_storage/variant.rb')
-rw-r--r-- | activestorage/app/models/active_storage/variant.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/activestorage/app/models/active_storage/variant.rb b/activestorage/app/models/active_storage/variant.rb index 239df34d81..ea57fa5f78 100644 --- a/activestorage/app/models/active_storage/variant.rb +++ b/activestorage/app/models/active_storage/variant.rb @@ -101,14 +101,8 @@ class ActiveStorage::Variant end end - def transform(image) - result = variation.transform(image, format: format) - - begin - yield result - ensure - result.close! - end + def transform(image, &block) + variation.transform(image, format: format, &block) end def upload(file) |