Update association

This commit is contained in:
Matt-Yorkley
2023-08-07 15:01:01 +01:00
parent cffd7073e2
commit 33d40ed750

View File

@@ -5,8 +5,8 @@ module Spree
acts_as_nested_set dependent: :destroy
belongs_to :taxonomy, class_name: 'Spree::Taxonomy', touch: true
has_many :classifications, dependent: :destroy
has_many :products, through: :classifications
has_many :products, class_name: "Spree::Product", foreign_key: "primary_taxon_id",
inverse_of: :primary_taxon
before_create :set_permalink