aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage')
-rw-r--r--activestorage/app/models/active_storage/variation.rb14
-rw-r--r--activestorage/webpack.config.js1
2 files changed, 8 insertions, 7 deletions
diff --git a/activestorage/app/models/active_storage/variation.rb b/activestorage/app/models/active_storage/variation.rb
index 13bad87cac..6a8825f1a8 100644
--- a/activestorage/app/models/active_storage/variation.rb
+++ b/activestorage/app/models/active_storage/variation.rb
@@ -44,13 +44,15 @@ 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. The transformed image instance is then returned.
+ # and performs the +transformations+ against it.
def transform(image)
- transformations.each do |(method, argument)|
- if eligible_argument?(argument)
- image.public_send(method, argument)
- else
- image.public_send(method)
+ image.mogrify do |command|
+ transformations.each do |method, argument|
+ if eligible_argument?(argument)
+ command.public_send(method, argument)
+ else
+ command.public_send(method)
+ end
end
end
end
diff --git a/activestorage/webpack.config.js b/activestorage/webpack.config.js
index 92c4530e7f..3a50eef470 100644
--- a/activestorage/webpack.config.js
+++ b/activestorage/webpack.config.js
@@ -1,4 +1,3 @@
-const webpack = require("webpack")
const path = require("path")
module.exports = {