From 9a9a681ea2e2d1f812267164733da40e1fd2d460 Mon Sep 17 00:00:00 2001 From: cesartalves Date: Thu, 15 Apr 2021 15:05:54 -0300 Subject: Fix Spree::OrdersController decoration The CreateSubscriptionLineItems decoration for the Front-end controller will break (obviously) if the Spree::OrdersController is not defined. However, some users might want to use the extension using only the Backend and Core of Solidus. This skips the decoration if Spree::Frontend is not defined --- .../spree/orders_controller/create_subscription_line_items.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/decorators/controllers/solidus_subscriptions/spree/orders_controller/create_subscription_line_items.rb b/app/decorators/controllers/solidus_subscriptions/spree/orders_controller/create_subscription_line_items.rb index 6b39b4c..394d025 100644 --- a/app/decorators/controllers/solidus_subscriptions/spree/orders_controller/create_subscription_line_items.rb +++ b/app/decorators/controllers/solidus_subscriptions/spree/orders_controller/create_subscription_line_items.rb @@ -32,4 +32,6 @@ module SolidusSubscriptions end end -Spree::OrdersController.prepend(SolidusSubscriptions::Spree::OrdersController::CreateSubscriptionLineItems) +if defined? Spree::Frontend + Spree::OrdersController.prepend(SolidusSubscriptions::Spree::OrdersController::CreateSubscriptionLineItems) +end -- cgit v1.2.3