From 5873295070779b1ec78a579826244a5b762d5df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Fri, 15 Apr 2022 12:06:46 +0200 Subject: [PATCH] Deprecate usage of legacy event system Once we've the upgrade guide complete, we'll update the message with a link to it. --- core/lib/spree/core/engine.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/lib/spree/core/engine.rb b/core/lib/spree/core/engine.rb index ce9f74cfc48..9a67a5bea9e 100644 --- a/core/lib/spree/core/engine.rb +++ b/core/lib/spree/core/engine.rb @@ -90,6 +90,16 @@ class Engine < ::Rails::Engine Spree::UsersController.protect_from_forgery with: :exception end end + + config.after_initialize do + if Spree::Config.use_legacy_events && !ENV['CI'] + Spree::Deprecation.warn <<~MSG + Your Solidus store is using the legacy event system. You're + encouraged to switch to the new event bus. After you're done, you + can remove the `use_legacy_events` setting from `spree.rb`. + MSG + end + end end end end