From 37a4c73a12b2dcba4c5869ab92d43fcbe01a641e Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 8 Jun 2023 19:34:21 +0100 Subject: [PATCH] Fix rubocop complaint --- app/controllers/voucher_adjustments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/voucher_adjustments_controller.rb b/app/controllers/voucher_adjustments_controller.rb index 4ee0c3d3fe..267e2d367b 100644 --- a/app/controllers/voucher_adjustments_controller.rb +++ b/app/controllers/voucher_adjustments_controller.rb @@ -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