Browse Source

Add more options to the validation (#383)

pull/384/head
kosiakkatrina 3 years ago committed by GitHub
parent
commit
b6f7a0d232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/validations/household_validations.rb

2
app/models/validations/household_validations.rb

@ -80,7 +80,7 @@ module Validations::HouseholdValidations
record.errors.add :sex1, I18n.t("validations.household.gender.male_refuge")
end
if record.is_internal_transfer? && [3, 4, 10, 13, 19, 23, 24, 25, 26, 28, 29].include?(record.prevten)
if record.is_internal_transfer? && [3, 4, 7, 9, 10, 13, 14, 19, 21, 23, 24, 25, 26, 27, 28, 29].include?(record.prevten)
label = record.form.get_question("prevten").present? ? record.form.get_question("prevten").label_from_value(record.prevten) : ""
record.errors.add :prevten, I18n.t("validations.household.prevten.internal_transfer", prevten: label)
record.errors.add :referral, I18n.t("validations.household.referral.prevten_invalid", prevten: label)

Loading…
Cancel
Save