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
Automatically order product option types by position (#12168)
Damian Legawiecd0413b78f885
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rbindex b970af6acf..921661b197 100644--- a/core/app/models/spree/product.rb+++ b/core/app/models/spree/product.rb@@ -69,7 +69,7 @@ module Spree# https://github.com/rails/rails/issues/3458before_destroy :ensure_not_in_complete_orders- has_many :product_option_types, dependent: :destroy, inverse_of: :product+ has_many :product_option_types, -> { order(:position) }, dependent: :destroy, inverse_of: :producthas_many :option_types, through: :product_option_typeshas_many :product_properties, dependent: :destroy, inverse_of: :producthas_many :properties, through: :product_properties