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