Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions core/app/models/spree/taxon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class Taxon < Spree::Base
has_many :classifications, -> { order(:position) }, dependent: :delete_all, inverse_of: :taxon
has_many :products, through: :classifications

has_many :promotion_rule_taxons
has_many :promotion_rules, through: :promotion_rule_taxons

before_save :set_permalink
after_update :update_child_permalinks, if: :saved_change_to_permalink?

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module SolidusLegacyPromotions
module SpreeTaxonPatch
def self.prepended(base)
base.has_many :promotion_rule_taxons, dependent: :destroy
base.has_many :promotion_rules, through: :promotion_rule_taxons
end

::Spree::Taxon.prepend self
end
end