mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
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:
committed by
Gaetan Craig-Riou
parent
be1a72743a
commit
ef62fb885d
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user