1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Require mini_magick when it's used

This commit is contained in:
George Claghorn 2017-07-23 17:06:45 -04:00
parent df69899161
commit ac26aef11f

View file

@ -1,5 +1,4 @@
require "active_storage/blob"
require "mini_magick"
# Image blobs can have variants that are the result of a set of transformations applied to the original.
class ActiveStorage::Variant
@ -30,6 +29,7 @@ class ActiveStorage::Variant
end
def transform(io)
require "mini_magick"
File.open MiniMagick::Image.read(io).tap { |image| variation.transform(image) }.path
end
end