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
Unify OptionType#filter_param with Property#filter_param format
Damian Legawiec109c0bf278b0
diff --git a/core/app/models/spree/option_type.rb b/core/app/models/spree/option_type.rbindex bd4abab517..978364a081 100644--- a/core/app/models/spree/option_type.rb+++ b/core/app/models/spree/option_type.rb@@ -26,7 +26,7 @@ module Spreeafter_touch :touch_all_productsdef filter_param- name.titleize.delete(' ').downcase+ name.parameterizeenddef self.colordiff --git a/core/spec/models/spree/option_type_spec.rb b/core/spec/models/spree/option_type_spec.rbindex 0758edd5fa..cff2a25ef5 100644--- a/core/spec/models/spree/option_type_spec.rb+++ b/core/spec/models/spree/option_type_spec.rb@@ -12,19 +12,19 @@ describe Spree::OptionType, type: :model doendend- context '#filter_param' do+ describe '#filter_param' dolet!(:option_type) { create(:option_type, name: 'color', presentation: 'Color') }let!(:other_option_type) { create(:option_type, name: 'secondary color', presentation: 'Secondary Color') }let!(:some_option_type) { create(:option_type, name: 'option type', presentation: 'Some Option Type') }it 'returns filtered name param' doexpect(option_type.filter_param).to eq('color')- expect(other_option_type.filter_param).to eq('secondarycolor')- expect(some_option_type.filter_param).to eq('optiontype')+ expect(other_option_type.filter_param).to eq('secondary-color')+ expect(some_option_type.filter_param).to eq('option-type')endend- context '#self.color' do+ describe '#self.color' dolet!(:option_type) { create(:option_type, name: 'color', presentation: 'Color') }it 'finds color option type' do