From d30861f76991d9dee5f9bdb12339299a5e0eeb9a Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 15 Jun 2023 15:08:07 +0100 Subject: [PATCH] feat: don't show secondary client group if has another client group is no --- app/helpers/schemes_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/schemes_helper.rb b/app/helpers/schemes_helper.rb index 0503f88b3..0656d556e 100644 --- a/app/helpers/schemes_helper.rb +++ b/app/helpers/schemes_helper.rb @@ -10,7 +10,6 @@ module SchemesHelper { name: "Support services provided by", value: scheme.arrangement_type }, { name: "Primary client group", value: scheme.primary_client_group }, { name: "Has another client group", value: scheme.has_other_client_group }, - { name: "Secondary client group", value: scheme.secondary_client_group }, { name: "Level of support given", value: scheme.support_type }, { name: "Intended length of stay", value: scheme.intended_stay }, { name: "Availability", value: scheme_availability(scheme) }, @@ -25,7 +24,9 @@ module SchemesHelper end if scheme.has_other_client_group == "Yes" - base_attributes.append + insertion_index = base_attributes.index { |attribute| attribute[:name] == "Has another client group" } + 1 + base_attributes.insert(insertion_index, { name: "Secondary client group", value: scheme.secondary_client_group }) + end base_attributes