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
correct Option Value scopes
Łukasz Adamczyk1bcbb77c971e
diff --git a/core/app/models/spree/option_value.rb b/core/app/models/spree/option_value.rbindex 398b9d9251..12dd1fb3af 100644--- a/core/app/models/spree/option_value.rb+++ b/core/app/models/spree/option_value.rb@@ -12,12 +12,15 @@ module Spreeendscope :filterable, lambda {- joins(:option_type, :variants).+ joins(:option_type).where(OptionType.table_name => { filterable: true }).distinct}- scope :for_products, ->(products) { where(Variant.table_name => { product_id: products.map(&:id) }) }+ scope :for_products, lambda { |products|+ joins(:variants).+ where(Variant.table_name => { product_id: products.map(&:id) })+ }after_touch :touch_all_variants