From 70fe970ae59d233ea87ff45bb236cef712e19601 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 2 Mar 2026 14:40:11 +0000 Subject: [PATCH] CLDC-4243: Use question.suffix_label in range error (#3191) this will correctly do any calculations if a dictionary suffix is provided --- app/models/validations/shared_validations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb index 4558a5a36..9c3a27f87 100644 --- a/app/models/validations/shared_validations.rb +++ b/app/models/validations/shared_validations.rb @@ -105,8 +105,8 @@ private def add_range_error(record, question) field = question.check_answer_label || question.id - min = [question.prefix, number_with_delimiter(question.min, delimiter: ","), question.suffix].join("") if question.min - max = [question.prefix, number_with_delimiter(question.max, delimiter: ","), question.suffix].join("") if question.max + min = [question.prefix, number_with_delimiter(question.min, delimiter: ","), question.suffix_label(record)].join("") if question.min + max = [question.prefix, number_with_delimiter(question.max, delimiter: ","), question.suffix_label(record)].join("") if question.max if min && max record.errors.add question.id.to_sym, :outside_the_range, message: I18n.t("validations.shared.numeric.within_range", field:, min:, max:)