From 847593064916192396ee65d5bf03f59209e04452 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Thu, 2 Oct 2025 15:09:49 +0200 Subject: [PATCH] Make decorators compatible with Zeitwerk Module names are changed according to what Zeitwerk expects to find in those files. I'm not sure we'd rather rename these, as keeping the file names consistent may help in future upgrades when incorporating upstream changes. --- .../spree/permitted_attributes_decorator.rb | 6 +++--- .../models/solidus_braintree/spree/credit_card_decorator.rb | 4 ++-- .../models/solidus_braintree/spree/payment_decorator.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/decorators/lib/solidus_braintree/spree/permitted_attributes_decorator.rb b/app/decorators/lib/solidus_braintree/spree/permitted_attributes_decorator.rb index 10e14ea1..db97d5e9 100644 --- a/app/decorators/lib/solidus_braintree/spree/permitted_attributes_decorator.rb +++ b/app/decorators/lib/solidus_braintree/spree/permitted_attributes_decorator.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -module PermittedAttributesDecorator +module Lib::SolidusBraintree::Spree::PermittedAttributesDecorator def self.prepended(base) - base.singleton_class.prepend SolidusBraintree::PermittedAttributesConcern + base.prepend ::SolidusBraintree::PermittedAttributesConcern end - Spree::PermittedAttributes.singleton_class.prepend(self) + ::Spree::PermittedAttributes.singleton_class.prepend(self) end diff --git a/app/decorators/models/solidus_braintree/spree/credit_card_decorator.rb b/app/decorators/models/solidus_braintree/spree/credit_card_decorator.rb index 90829b8c..4b6ff534 100644 --- a/app/decorators/models/solidus_braintree/spree/credit_card_decorator.rb +++ b/app/decorators/models/solidus_braintree/spree/credit_card_decorator.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -module CreditCardDecorator +module Models::SolidusBraintree::Spree::CreditCardDecorator def self.prepended(base) base.include SolidusBraintree::SkipRequireCardNumbersConcern base.include SolidusBraintree::AddNameValidationConcern base.include SolidusBraintree::UseDataFieldConcern end - Spree::CreditCard.prepend(self) + ::Spree::CreditCard.prepend(self) end diff --git a/app/decorators/models/solidus_braintree/spree/payment_decorator.rb b/app/decorators/models/solidus_braintree/spree/payment_decorator.rb index c0e2c172..24f707f3 100644 --- a/app/decorators/models/solidus_braintree/spree/payment_decorator.rb +++ b/app/decorators/models/solidus_braintree/spree/payment_decorator.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -module PaymentDecorator +module Models::SolidusBraintree::Spree::PaymentDecorator def self.prepended(base) base.include SolidusBraintree::PaymentBraintreeNonceConcern base.include SolidusBraintree::InjectDeviceDataConcern end - Spree::Payment.prepend(self) + ::Spree::Payment.prepend(self) end