Skip to content

Commit

Permalink
Fix(promotions): Validate benefits on save
Browse files Browse the repository at this point in the history
On Slack, we got a report that the tiered percent calculator wasn't
converting its tiers to BigDecimal when being first created. Since this
conversion happens `before_validation`, we should not turn validation
off in this controller.

Specs still run through.
  • Loading branch information
mamhoff committed Dec 3, 2024
1 parent 9013f71 commit 42d65fd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def new
def create
@benefit = @benefit_type.new(benefit_params)
@benefit.promotion = @promotion
if @benefit.save(validate: false)
if @benefit.save
flash[:success] =
t("spree.successfully_created", resource: SolidusPromotions::Benefit.model_name.human)
redirect_to location_after_save, format: :html
Expand Down

0 comments on commit 42d65fd

Please sign in to comment.