diff options
author | George Claghorn <george@basecamp.com> | 2017-12-11 18:30:21 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2017-12-11 18:30:21 -0500 |
commit | 931fe37aa78b9af9f779ac750cf2fa132e049c2b (patch) | |
tree | 67ff1d19ba25a477c866abc1b2898d8aa93aed39 /activestorage | |
parent | b9de7ea8d1adf4203afb6a5da912f11fb2b61541 (diff) | |
download | rails-931fe37aa78b9af9f779ac750cf2fa132e049c2b.tar.gz rails-931fe37aa78b9af9f779ac750cf2fa132e049c2b.tar.bz2 rails-931fe37aa78b9af9f779ac750cf2fa132e049c2b.zip |
Revert "Invoke mogrify once when transforming an image"
This reverts commit a80f81af055f02bf4625c90470aa90441cf6fc24.
Diffstat (limited to 'activestorage')
-rw-r--r-- | activestorage/app/models/active_storage/variation.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/activestorage/app/models/active_storage/variation.rb b/activestorage/app/models/active_storage/variation.rb index 6a8825f1a8..13bad87cac 100644 --- a/activestorage/app/models/active_storage/variation.rb +++ b/activestorage/app/models/active_storage/variation.rb @@ -44,15 +44,13 @@ class ActiveStorage::Variation end # Accepts an open MiniMagick image instance, like what's returned by <tt>MiniMagick::Image.read(io)</tt>, - # and performs the +transformations+ against it. + # and performs the +transformations+ against it. The transformed image instance is then returned. def transform(image) - image.mogrify do |command| - transformations.each do |method, argument| - if eligible_argument?(argument) - command.public_send(method, argument) - else - command.public_send(method) - end + transformations.each do |(method, argument)| + if eligible_argument?(argument) + image.public_send(method, argument) + else + image.public_send(method) end end end |