Browse Source

add validation messge for other values

pull/2970/head
Carolyn 2 months ago
parent
commit
7ed5ed188b
  1. 11
      app/services/bulk_upload/sales/year2025/row_parser.rb

11
app/services/bulk_upload/sales/year2025/row_parser.rb

@ -1473,6 +1473,17 @@ private
%w[0] + GlobalConstants::COUNTRIES_ANSWER_OPTIONS.keys # 0 is "Prefers not to say" %w[0] + GlobalConstants::COUNTRIES_ANSWER_OPTIONS.keys # 0 is "Prefers not to say"
end end
def validate_relat_fields
%i[field_34 field_42 field_46 field_50 field_54].each do |field|
value = send(field)
next if value.blank?
unless (1..3).cover?(value)
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field])))
end
end
end
def bulk_upload_organisation def bulk_upload_organisation
Organisation.find(bulk_upload.organisation_id) Organisation.find(bulk_upload.organisation_id)
end end

Loading…
Cancel
Save