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
Fix `Spree::Variant.eligible` so it works without using numeric IDs (#12207)
Damian Kaczmarczyke55edff3f3c6
diff --git a/core/app/models/spree/variant.rb b/core/app/models/spree/variant.rbindex 5ff8f2d785..0d246b4810 100644--- a/core/app/models/spree/variant.rb+++ b/core/app/models/spree/variant.rb@@ -76,13 +76,10 @@ module Spreescope :eligible, -> {where(is_master: false).or(where(- <<-SQL- #{Variant.quoted_table_name}.id IN (- SELECT MIN(#{Variant.quoted_table_name}.id) FROM #{Variant.quoted_table_name}- GROUP BY #{Variant.quoted_table_name}.product_id- HAVING COUNT(*) = 1- )- SQL+ product_id: Spree::Variant.+ select(:product_id).+ group(:product_id).+ having("COUNT(#{Spree::Variant.table_name}.id) = 1")))}