Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Proper way of using `Spree.user_class` in association for CreditCard (#12624)

Damian Legawiec09e8024d8742
diff --git a/core/app/models/spree/credit_card.rb b/core/app/models/spree/credit_card.rb
index a4c15f9d32..107cc48af5 100644
--- a/core/app/models/spree/credit_card.rb
+++ b/core/app/models/spree/credit_card.rb
@@ -12,7 +12,7 @@ module Spree
acts_as_paranoid
belongs_to :payment_method
- belongs_to :user, class_name: "::#{Spree.user_class}", foreign_key: 'user_id', optional: true
+ belongs_to :user, class_name: Spree.user_class.to_s, foreign_key: 'user_id', optional: true
belongs_to :gateway_customer, class_name: 'Spree::GatewayCustomer', optional: true
has_many :payments, as: :source