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
workaround for mobility bug with first_or_initialize
nciemniakd59e7f96115e
diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rbindex 953aa777f9..c7d494e0d2 100644--- a/core/app/models/spree/store.rb+++ b/core/app/models/spree/store.rb@@ -124,7 +124,12 @@ module Spree# this behaviour is very buggy and unpredictabledef self.defaultRails.cache.fetch('default_store') do- where(default: true).first_or_initialize+ # workaround for Mobility bug with first_or_initialize+ if where(default: true).any?+ where(default: true).first+ else+ new(default: true)+ endendend