From c8478adde711c672bfe572828df11ee0a32c4829 Mon Sep 17 00:00:00 2001 From: Ben Abraham <16797406+Kizr@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:16:13 +0100 Subject: [PATCH] Add nursery and reception year group options --- app/models/placement.rb | 2 ++ config/locales/en/placements/schools/placements.yml | 4 ++++ ...008153148_add_new_year_groups_to_placement_year_group.rb | 6 ++++++ db/schema.rb | 2 +- spec/models/placement_spec.rb | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20241008153148_add_new_year_groups_to_placement_year_group.rb diff --git a/app/models/placement.rb b/app/models/placement.rb index b66c46cf5..e11cfad39 100644 --- a/app/models/placement.rb +++ b/app/models/placement.rb @@ -44,6 +44,8 @@ class Placement < ApplicationRecord attribute :year_group, :string enum :year_group, { + nursery: "nursery", + reception: "reception", year_1: "year_1", year_2: "year_2", year_3: "year_3", diff --git a/config/locales/en/placements/schools/placements.yml b/config/locales/en/placements/schools/placements.yml index 4b99d13e8..9b44f541e 100644 --- a/config/locales/en/placements/schools/placements.yml +++ b/config/locales/en/placements/schools/placements.yml @@ -59,6 +59,10 @@ en: any_term: Any time in the academic year not_yet_known: Not yet known year_groups: + nursery: Nursery + nursery_description: 3 to 4 years + reception: Reception + reception_description: 4 to 5 years year_1: Year 1 year_1_description: 5 to 6 years year_2: Year 2 diff --git a/db/migrate/20241008153148_add_new_year_groups_to_placement_year_group.rb b/db/migrate/20241008153148_add_new_year_groups_to_placement_year_group.rb new file mode 100644 index 000000000..8864fc6a2 --- /dev/null +++ b/db/migrate/20241008153148_add_new_year_groups_to_placement_year_group.rb @@ -0,0 +1,6 @@ +class AddNewYearGroupsToPlacementYearGroup < ActiveRecord::Migration[7.2] + def change + add_enum_value :placement_year_group, "nursery", before: "year_1" + add_enum_value :placement_year_group, "reception", before: "year_1" + end +end diff --git a/db/schema.rb b/db/schema.rb index c3eb7d020..953a8181c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -20,7 +20,7 @@ create_enum "claim_status", ["internal_draft", "draft", "submitted", "payment_in_progress"] create_enum "mentor_training_type", ["refresher", "initial"] create_enum "placement_status", ["draft", "published"] - create_enum "placement_year_group", ["year_1", "year_2", "year_3", "year_4", "year_5", "year_6"] + create_enum "placement_year_group", ["nursery", "reception", "year_1", "year_2", "year_3", "year_4", "year_5", "year_6"] create_enum "provider_type", ["scitt", "lead_school", "university"] create_enum "service", ["claims", "placements"] create_enum "subject_area", ["primary", "secondary"] diff --git a/spec/models/placement_spec.rb b/spec/models/placement_spec.rb index 324b809f3..b737ae3ef 100644 --- a/spec/models/placement_spec.rb +++ b/spec/models/placement_spec.rb @@ -109,6 +109,8 @@ expect(options).to eq( [ + OpenStruct.new(value: "nursery", name: "Nursery", description: "3 to 4 years"), + OpenStruct.new(value: "reception", name: "Reception", description: "4 to 5 years"), OpenStruct.new(value: "year_1", name: "Year 1", description: "5 to 6 years"), OpenStruct.new(value: "year_2", name: "Year 2", description: "6 to 7 years"), OpenStruct.new(value: "year_3", name: "Year 3", description: "7 to 8 years"),