Fix rubocop complaint

This commit is contained in:
Matt-Yorkley
2023-06-08 19:34:21 +01:00
parent 9b45b71696
commit 37a4c73a12

View File

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