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
Removed not needed soft deletion from PriceRule
Damian Legawiec4a155b8d819c
diff --git a/core/app/models/spree/price_rule.rb b/core/app/models/spree/price_rule.rbindex 440d1b9af5..23cf9dc744 100644--- a/core/app/models/spree/price_rule.rb+++ b/core/app/models/spree/price_rule.rb@@ -1,20 +1,24 @@module Spree- class PriceRule < Spree::Base- acts_as_paranoid- include Spree::Preferences::Preferable+ class PriceRule < Spree.base_class+ belongs_to :price_list, class_name: 'Spree::PriceList', touch: true- belongs_to :price_list, class_name: 'Spree::PriceList'-- validates :type, presence: true+ validates :type, :price_list,presence: true+ # Returns true if the price rule is applicable to the context+ # @param context [Spree::Pricing::Context]+ # @return [Boolean]def applicable?(context)raise NotImplementedError, "#{self.class.name} must implement #applicable?"end+ # Returns the human name of the price rule+ # @return [String]def self.human_namename.demodulize.titleizeend+ # Returns the description of the price rule+ # @return [String]def self.description''enddiff --git a/core/db/migrate/20251110120001_create_spree_price_rules.rb b/core/db/migrate/20251110120001_create_spree_price_rules.rbindex 7e1ad96256..3a4b9f4ef8 100644--- a/core/db/migrate/20251110120001_create_spree_price_rules.rb+++ b/core/db/migrate/20251110120001_create_spree_price_rules.rb@@ -5,11 +5,9 @@ class CreateSpreePriceRules < ActiveRecord::Migration[7.0]t.string :type, null: falset.text :preferencest.timestamps- t.datetime :deleted_atendadd_index :spree_price_rules, [:price_list_id, :type]add_index :spree_price_rules, :type- add_index :spree_price_rules, :deleted_atendend