diff --git a/promotions/app/models/solidus_promotions/promotion.rb b/promotions/app/models/solidus_promotions/promotion.rb index e36015facac..7eacbbf61af 100644 --- a/promotions/app/models/solidus_promotions/promotion.rb +++ b/promotions/app/models/solidus_promotions/promotion.rb @@ -9,7 +9,7 @@ class Promotion < Spree::Base belongs_to :original_promotion, class_name: "Spree::Promotion", optional: true has_many :benefits, class_name: "SolidusPromotions::Benefit", dependent: :destroy has_many :conditions, through: :benefits - has_many :codes, class_name: "SolidusPromotions::PromotionCode", dependent: :destroy + has_many :codes, class_name: "SolidusPromotions::PromotionCode", dependent: :destroy, inverse_of: :promotion has_many :code_batches, class_name: "SolidusPromotions::PromotionCodeBatch", dependent: :destroy has_many :order_promotions, class_name: "SolidusPromotions::OrderPromotion", dependent: :destroy