Skip to content

Commit

Permalink
Fix(promotions): Add model_class method to PromotionCodesController
Browse files Browse the repository at this point in the history
Because the new promotion system lives outside the `spree` namespace, we
need to be diligent about adding `model_class` to all the controllers.

I have not added a spec, because this only fails if
solidus_legacy_promotions is not loaded, and that is not the case in our
test suite.
  • Loading branch information
mamhoff committed Dec 3, 2024
1 parent 9013f71 commit d62cc83
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def load_promotion
.accessible_by(current_ability, :show)
.find(params[:promotion_id])
end

def model_class
SolidusPromotions::PromotionCode
end
end
end
end

0 comments on commit d62cc83

Please sign in to comment.