Check if record actually saved

I'm not sure if it will ever make a difference, but I think this makes more sense.
This commit is contained in:
David Cook
2023-07-27 16:35:43 +10:00
committed by Gaetan Craig-Riou
parent be1a72743a
commit ef62fb885d

View File

@@ -38,7 +38,7 @@ class VoucherAdjustmentsController < BaseController
adjustment = voucher.create_adjustment(voucher.code, @order)
unless adjustment.valid?
unless adjustment.persisted?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.add_voucher_error'))
adjustment.errors.each { |error| @order.errors.import(error) }
return false