Skip to content

Commit

Permalink
Add nursery and reception year group options
Browse files Browse the repository at this point in the history
  • Loading branch information
Kizr committed Oct 11, 2024
1 parent 77bdc8e commit c8478ad
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/placement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions config/locales/en/placements/schools/placements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 2 additions & 0 deletions spec/models/placement_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit c8478ad

Please sign in to comment.