From f0ae357e19bf3cdafe1c1243b65c72bbcb5616f1 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 22 Dec 2023 11:27:53 +0100 Subject: [PATCH 1/3] Don't try to autoload the deface overrides folder --- lib/solidus_paypal_commerce_platform/engine.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/solidus_paypal_commerce_platform/engine.rb b/lib/solidus_paypal_commerce_platform/engine.rb index 030ac7b..c8bbbe9 100644 --- a/lib/solidus_paypal_commerce_platform/engine.rb +++ b/lib/solidus_paypal_commerce_platform/engine.rb @@ -14,6 +14,10 @@ class Engine < Rails::Engine engine_name 'solidus_paypal_commerce_platform' + initializer "solidus_paypal_commerce_platform.zeitwerk_ignore_deface_overrides", before: :eager_load! do |app| + app.autoloaders.main.ignore(root.join('app/overrides')) + end + initializer "solidus_paypal_commerce_platform.add_payment_method", after: "spree.register.payment_methods" do |app| app.config.to_prepare do app.config.spree.payment_methods << SolidusPaypalCommercePlatform::PaymentMethod From cf0c392aab725d22a31b1b8c08a2ea4cd13e8cc7 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 22 Dec 2023 11:48:27 +0100 Subject: [PATCH 2/3] Use an absolute reference to Spree Avoid situations in which Zeitwerk will reach to SPCP::Spree first. --- .../install/install_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/solidus_paypal_commerce_platform/install/install_generator.rb b/lib/generators/solidus_paypal_commerce_platform/install/install_generator.rb index 643c392..582bb16 100644 --- a/lib/generators/solidus_paypal_commerce_platform/install/install_generator.rb +++ b/lib/generators/solidus_paypal_commerce_platform/install/install_generator.rb @@ -92,7 +92,7 @@ def alert_no_classic_frontend_support private def solidus_mount_point - mount_point = Spree::Core::Engine.routes.find_script_name({}) + mount_point = ::Spree::Core::Engine.routes.find_script_name({}) mount_point += "/" unless mount_point.end_with?("/") mount_point end From b699238f627fdc213b07a80a99b200a913f8dbed Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 22 Dec 2023 11:50:03 +0100 Subject: [PATCH 3/3] Disable line length checks We have huge screens. --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index aed1e4d..54812b7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -69,3 +69,6 @@ Rails/Inquiry: Enabled: true Exclude: - spec/lib/solidus_paypal_commerce_platform/configuration_spec.rb + +Layout/LineLength: + Enabled: false