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.

Add `foreign_key` name for user's `gateway_customers` association (#12592)

Damian Kaczmarczyk2c9da9ee7109
diff --git a/core/app/models/concerns/spree/user_methods.rb b/core/app/models/concerns/spree/user_methods.rb
index 8e055fdf92..8c8426cc73 100644
--- a/core/app/models/concerns/spree/user_methods.rb
+++ b/core/app/models/concerns/spree/user_methods.rb
@@ -30,7 +30,7 @@ module Spree
has_many :store_credits, class_name: 'Spree::StoreCredit', foreign_key: :user_id, dependent: :destroy
has_many :wishlists, class_name: 'Spree::Wishlist', foreign_key: :user_id, dependent: :destroy
has_many :wished_items, through: :wishlists, source: :wished_items
- has_many :gateway_customers, class_name: 'Spree::GatewayCustomer'
+ has_many :gateway_customers, class_name: 'Spree::GatewayCustomer', foreign_key: :user_id
belongs_to :ship_address, class_name: 'Spree::Address', optional: true
belongs_to :bill_address, class_name: 'Spree::Address', optional: true