Browse Source

feat: remove numbering

pull/1178/head
natdeanlewissoftwire 3 years ago
parent
commit
9889d1df17
  1. 6
      app/models/validations/sales/household_validations.rb
  2. 5
      config/locales/en.yml

6
app/models/validations/sales/household_validations.rb

@ -25,9 +25,9 @@ private
return unless age && relationship return unless age && relationship
if age < 16 && person_is_partner?(relationship) if age < 16 && person_is_partner?(relationship)
record.errors.add "relat#{person_num}", I18n.t("validations.household.relat.partner_under_16", person_num:) record.errors.add "relat#{person_num}", I18n.t("validations.household.relat.partner_under_16")
elsif age >= 20 && person_is_child?(relationship) elsif age >= 20 && person_is_child?(relationship)
record.errors.add "relat#{person_num}", I18n.t("validations.household.relat.child_over_20", person_num:) record.errors.add "relat#{person_num}", I18n.t("validations.household.relat.child_over_20")
end end
end end
@ -38,7 +38,7 @@ private
return unless age && economic_status && relationship return unless age && economic_status && relationship
if age >= 16 && age <= 19 && !person_is_child?(relationship) && person_is_fulltime_student?(economic_status) if age >= 16 && age <= 19 && !person_is_child?(relationship) && person_is_fulltime_student?(economic_status)
record.errors.add "relat#{person_num}", I18n.t("validations.household.relat.student_16_19_sales", person_num:) record.errors.add "relat#{person_num}", I18n.t("validations.household.relat.student_16_19_sales")
end end
end end

5
config/locales/en.yml

@ -299,7 +299,6 @@ en:
child_over_16: "Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘" child_over_16: "Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘"
student_16_19: "Answer cannot be between 16 and 19 as person %{person_num} is a child of the lead tenant but is not a full-time student" student_16_19: "Answer cannot be between 16 and 19 as person %{person_num} is a child of the lead tenant but is not a full-time student"
partner_under_16: "Cannot be under 16 if the relationship is partner" partner_under_16: "Cannot be under 16 if the relationship is partner"
child_over_20: "Cannot be 20 or over as the relationship is child"
lead: lead:
over_20: "The lead tenant must be under 20 as you told us their housing situation immediately before this letting was a children’s home or foster care" over_20: "The lead tenant must be under 20 as you told us their housing situation immediately before this letting was a children’s home or foster care"
ecstat: ecstat:
@ -311,11 +310,11 @@ en:
retired_female: "Answer cannot be ‘retired’ as the female tenant is under 60" retired_female: "Answer cannot be ‘retired’ as the female tenant is under 60"
relat: relat:
partner_under_16: "Cannot be partner if the person's age is under 16" partner_under_16: "Cannot be partner if the person's age is under 16"
child_under_16: "Person’s %{person_num}’s relationship to tenant 1 must be ‘child’ as you told us they’re under 16" child_under_16: "Person’s relationship to tenant 1 must be ‘child’ as you told us they’re under 16"
child_over_20: "Relationship cannot be ‘child’ if the person's age is 20 or over" child_over_20: "Relationship cannot be ‘child’ if the person's age is 20 or over"
one_partner: "Number of partners cannot be greater than 1" one_partner: "Number of partners cannot be greater than 1"
student_16_19: "Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student" student_16_19: "Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student"
student_16_19_sales: "Person %{person_num} must be a child if they are aged 16-19 and a student" student_16_19_sales: "Person must be a child if they are aged 16-19 and a student"
housingneeds_a: housingneeds_a:
one_or_two_choices: "You can only select one option or ‘other disabled access needs’ plus ‘wheelchair-accessible housing’, ‘wheelchair access to essential rooms’ or ‘level access housing’" one_or_two_choices: "You can only select one option or ‘other disabled access needs’ plus ‘wheelchair-accessible housing’, ‘wheelchair access to essential rooms’ or ‘level access housing’"
prevten: prevten:

Loading…
Cancel
Save