From 3f225e0d77c695875235c76ea1fdf100696f228f Mon Sep 17 00:00:00 2001 From: 24c02 <163450896+24c02@users.noreply.github.com> Date: Fri, 19 Dec 2025 13:23:00 -0500 Subject: [PATCH] fix --- app/controllers/letter/batches_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/letter/batches_controller.rb b/app/controllers/letter/batches_controller.rb index 53b3bd2..45ae63a 100644 --- a/app/controllers/letter/batches_controller.rb +++ b/app/controllers/letter/batches_controller.rb @@ -242,11 +242,14 @@ class Letter::BatchesController < BaseBatchesController def validate_postage_types return unless @batch.letter_return_address&.us? - if @batch.us_postage_type.present? && !%w[stamps indicia].include?(@batch.us_postage_type) + us_postage_type = batch_params[:us_postage_type] + intl_postage_type = batch_params[:intl_postage_type] + + if us_postage_type.present? && !%w[stamps indicia].include?(us_postage_type) @batch.errors.add(:us_postage_type, "must be either 'stamps' or 'indicia'") end - if @batch.intl_postage_type.present? && !%w[stamps indicia].include?(@batch.intl_postage_type) + if intl_postage_type.present? && !%w[stamps indicia].include?(intl_postage_type) @batch.errors.add(:intl_postage_type, "must be either 'stamps' or 'indicia'") end end