From 93edf4e3adbc21580713a46fd0e65ebb37beb2e8 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 9 Aug 2024 14:25:29 +1000 Subject: [PATCH] Load MiniMagick before use We only reference MiniMagick when rescuing errors but when it's not loaded, that code fails to find the error class itself to apply the rescue block. The rescue block is covered by a spec but the code passes there as MiniMagick is loaded. We can see this error only in development, staging and production. --- app/models/enterprise.rb | 2 ++ app/models/spree/image.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 8dc1e5b129..9af23e4068 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -1,5 +1,7 @@ # frozen_string_literal: false +require "mini_magick" + class Enterprise < ApplicationRecord SELLS = %w(unspecified none own any).freeze ENTERPRISE_SEARCH_RADIUS = 100 diff --git a/app/models/spree/image.rb b/app/models/spree/image.rb index ae021c51df..77a463c301 100644 --- a/app/models/spree/image.rb +++ b/app/models/spree/image.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "mini_magick" + module Spree class Image < Asset has_one_attached :attachment, service: image_service do |attachment|