From dd5702907add079d708465aacdf34a769548e911 Mon Sep 17 00:00:00 2001 From: David Armour <15181647+dav-armour@users.noreply.github.com> Date: Mon, 9 Nov 2020 12:56:56 +1100 Subject: [PATCH] Fix loading of frontend decorators if frontend not available --- lib/spree_gateway/engine.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/spree_gateway/engine.rb b/lib/spree_gateway/engine.rb index fbaae6b7..84e05b3c 100644 --- a/lib/spree_gateway/engine.rb +++ b/lib/spree_gateway/engine.rb @@ -45,8 +45,10 @@ def self.activate Rails.application.config.cache_classes ? require(c) : load(c) end - Dir.glob(File.join(File.dirname(__FILE__), '../../lib/spree_frontend/controllers/spree/*_decorator*.rb')) do |c| - Rails.application.config.cache_classes ? require(c) : load(c) + if self.frontend_available? + Dir.glob(File.join(File.dirname(__FILE__), '../../lib/spree_frontend/controllers/spree/*_decorator*.rb')) do |c| + Rails.application.config.cache_classes ? require(c) : load(c) + end end end