mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 16:38:18 +00:00
fix
This commit is contained in:
parent
665bc1dcd2
commit
3f225e0d77
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue