Skip to content

Commit

Permalink
Merge pull request #5953 from SuperGoodSoft/fix/new-promotions-admin
Browse files Browse the repository at this point in the history
[FIX] A few small tweaks for the new promotion admin
  • Loading branch information
tvdeyen authored Dec 3, 2024
2 parents ca48c2d + 6ea8b43 commit fb99b20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion promotions/app/models/solidus_promotions/promotion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def create

private

def model_class
SolidusPromotions::PromotionCode
end

def load_promotion
@promotion = SolidusPromotions::Promotion
.accessible_by(current_ability, :show)
Expand Down

0 comments on commit fb99b20

Please sign in to comment.