Skip to content

armgit / spree

Public Imported from GitHub
0

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.

Added :filterable scope to Spree::OptionType

Nathaniel Nande01a62c019ca1
diff --git a/core/app/models/spree/option_type.rb b/core/app/models/spree/option_type.rb
index 8c0aa75d2c..bd4abab517 100644
--- a/core/app/models/spree/option_type.rb
+++ b/core/app/models/spree/option_type.rb
@@ -19,6 +19,8 @@ module Spree
default_scope { order(:position) }
+ scope :filterable, -> { where(filterable: true) }
+
accepts_nested_attributes_for :option_values, reject_if: ->(ov) { ov[:name].blank? || ov[:presentation].blank? }, allow_destroy: true
after_touch :touch_all_products