From ac26aef11f1be08917f3190b3d2b7ba4434444f7 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Sun, 23 Jul 2017 17:06:45 -0400 Subject: Require mini_magick when it's used --- app/models/active_storage/variant.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/active_storage') diff --git a/app/models/active_storage/variant.rb b/app/models/active_storage/variant.rb index 435033f980..c12c29c453 100644 --- a/app/models/active_storage/variant.rb +++ b/app/models/active_storage/variant.rb @@ -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 -- cgit v1.2.3