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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Improve a bit `Gateway#type` validation to be more flexible
Damian Legawiec10a6f0319653
diff --git a/core/app/models/spree/gateway.rb b/core/app/models/spree/gateway.rbindex 880f34823d..84553c9b60 100644--- a/core/app/models/spree/gateway.rb+++ b/core/app/models/spree/gateway.rb@@ -6,7 +6,7 @@ module Spreebefore_validation :set_name- validates :type, presence: true, inclusion: { in: -> { Spree::PaymentMethod.providers.map(&:to_s) } }+ validates :type, presence: true, inclusion: { in: :valid_providers_list }def payment_source_classCreditCard@@ -82,5 +82,9 @@ module Spreedef set_nameself.name ||= provider_class.name.demodulize.titleizeend++ def valid_providers_list+ Spree::PaymentMethod.providers.map(&:to_s)+ endendend