diff --git a/promotions/lib/controllers/backend/solidus_promotions/admin/promotions_controller.rb b/promotions/lib/controllers/backend/solidus_promotions/admin/promotions_controller.rb index 6a1e9a9fb7e..f84386e21af 100644 --- a/promotions/lib/controllers/backend/solidus_promotions/admin/promotions_controller.rb +++ b/promotions/lib/controllers/backend/solidus_promotions/admin/promotions_controller.rb @@ -11,8 +11,7 @@ class PromotionsController < BaseController def create @promotion = model_class.new(permitted_resource_params) - @promotion.codes.new(value: params[:single_code]) if params[:single_code].present? - + @promotion.codes.new(promotion: @promotion, value: params[:single_code]) if params[:single_code].present? if params[:code_batch] @code_batch = @promotion.code_batches.new(code_batch_params) end