Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] A few small tweaks for the new promotion admin #5953

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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