|
|
|
|
@ -544,9 +544,9 @@ private
|
|
|
|
|
|
|
|
|
|
fields.each do |field| |
|
|
|
|
if setup_question?(question) |
|
|
|
|
errors.add(field, I18n.t("validations.invalid_option", question: ensure_punctuation(QUESTIONS[field])&.downcase), category: :setup) |
|
|
|
|
errors.add(field, I18n.t("validations.invalid_option", question: ensure_punctuation(downcase(QUESTIONS[field]))), category: :setup) |
|
|
|
|
else |
|
|
|
|
errors.add(field, I18n.t("validations.invalid_option", question: ensure_punctuation(QUESTIONS[field])&.downcase)) |
|
|
|
|
errors.add(field, I18n.t("validations.invalid_option", question: ensure_punctuation(downcase(QUESTIONS[field])))) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
@ -764,14 +764,14 @@ private
|
|
|
|
|
fields.each do |field| |
|
|
|
|
if errors.select { |e| fields.include?(e.attribute) }.none? |
|
|
|
|
question_text = question.error_display_label.presence || "this question." |
|
|
|
|
errors.add(field, I18n.t("validations.not_answered", question: question_text.downcase), category: :setup) if field.present? |
|
|
|
|
errors.add(field, I18n.t("validations.not_answered", question: downcase(question_text)), category: :setup) if field.present? |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
fields.each do |field| |
|
|
|
|
unless errors.any? { |e| fields.include?(e.attribute) } |
|
|
|
|
question_text = question.error_display_label.presence || "this question." |
|
|
|
|
errors.add(field, I18n.t("validations.not_answered", question: question_text.downcase), category: :not_answered) |
|
|
|
|
errors.add(field, I18n.t("validations.not_answered", question: downcase(question_text)), category: :not_answered) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
@ -1607,4 +1607,8 @@ private
|
|
|
|
|
def is_carehome |
|
|
|
|
field_127.present? ? 1 : 0 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def downcase(str) |
|
|
|
|
downcase_first_letter(str) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|