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
Add memoization to Store#supported_currencies_list
Damian Legawiec4c91e573c32c
diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rbindex 47f9061fbe..4807d3cc60 100644--- a/core/app/models/spree/store.rb+++ b/core/app/models/spree/store.rb@@ -44,7 +44,7 @@ module Spreeenddef supported_currencies_list- (read_attribute(:supported_currencies).to_s.split(',') << default_currency).map(&:to_s).map do |code|+ @supported_currencies_list ||= (read_attribute(:supported_currencies).to_s.split(',') << default_currency).map(&:to_s).map do |code|::Money::Currency.find(code.strip)end.uniq.compactend