diff --git a/app/helpers/tab_nav_helper.rb b/app/helpers/tab_nav_helper.rb index 07fd99ab7..c718ebb83 100644 --- a/app/helpers/tab_nav_helper.rb +++ b/app/helpers/tab_nav_helper.rb @@ -8,7 +8,7 @@ module TabNavHelper def scheme_cell(scheme) link_text = scheme.service_name.presence - [govuk_link_to(link_text, scheme), "Scheme #{scheme.service_name}"].join("\n") + [govuk_link_to(link_text, scheme), "Scheme #{scheme.primary_client_group}"].join("\n") end def org_cell(user) diff --git a/db/migrate/20220613094847_add_missing_attributes_to_scheme.rb b/db/migrate/20220613094847_add_missing_attributes_to_scheme.rb new file mode 100644 index 000000000..15c08a8cc --- /dev/null +++ b/db/migrate/20220613094847_add_missing_attributes_to_scheme.rb @@ -0,0 +1,12 @@ +class AddMissingAttributesToScheme < ActiveRecord::Migration[7.0] + def change + add_column :schemes, :primary_client_group, :string + add_column :schemes, :secondary_client_group, :string + add_column :schemes, :sensitive, :boolean + add_column :schemes, :total_units, :boolean + add_column :schemes, :scheme_type, :integer + add_column :schemes, :registered_under_care_act, :boolean + add_column :schemes, :support_type, :integer + add_column :schemes, :intended_stay, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index cd132897d..0516323b3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_06_08_144156) do +ActiveRecord::Schema[7.0].define(version: 2022_06_13_094847) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -283,6 +283,14 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_08_144156) do t.bigint "organisation_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "primary_client_group" + t.string "secondary_client_group" + t.boolean "sensitive" + t.boolean "total_units" + t.integer "scheme_type" + t.boolean "registered_under_care_act" + t.integer "support_type" + t.string "intended_stay" t.index ["organisation_id"], name: "index_schemes_on_organisation_id" end diff --git a/db/seeds.rb b/db/seeds.rb index 356e020b4..fdc09b37c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -74,6 +74,7 @@ unless Rails.env.test? code: "S878", service_name: "Beulahside Care", organisation: org, + primary_client_group: "Some Improtant Group", created_at: Time.zone.now, ) @@ -81,6 +82,7 @@ unless Rails.env.test? code: "S312", service_name: "Abdullahview Point", organisation: org, + primary_client_group: "Some Improtant Group", created_at: Time.zone.now, ) @@ -88,6 +90,7 @@ unless Rails.env.test? code: "7XYZ", service_name: "Caspermouth Center", organisation: dummy_org, + primary_client_group: "Some Improtant Group", created_at: Time.zone.now, ) end diff --git a/spec/factories/scheme.rb b/spec/factories/scheme.rb index 8d15032fe..42c6d243f 100644 --- a/spec/factories/scheme.rb +++ b/spec/factories/scheme.rb @@ -2,6 +2,7 @@ FactoryBot.define do factory :scheme do code { Faker::Name.initials(number: 4) } service_name { Faker::Name.name_with_middle } + primary_client_group { Faker::Name.name_with_middle } organisation created_at { Time.zone.now } end