From 21b6b34458490c3940eb61f5f6143e0d6ab61034 Mon Sep 17 00:00:00 2001 From: Tony Headford Date: Tue, 4 Jun 2024 15:04:04 +0100 Subject: [PATCH] Make performance stats use active registration cohort --- app/controllers/admin/performance/overview_controller.rb | 9 +++++---- app/views/admin/performance/overview/show.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/performance/overview_controller.rb b/app/controllers/admin/performance/overview_controller.rb index 01757e2925..b9fb94f1cc 100644 --- a/app/controllers/admin/performance/overview_controller.rb +++ b/app/controllers/admin/performance/overview_controller.rb @@ -5,17 +5,18 @@ class OverviewController < Admin::BaseController skip_after_action :verify_authorized, only: :show skip_after_action :verify_policy_scoped, only: :show - # show 2023 pilot stats + # show active registration cohort stats def show - @pilot_stats = get_pilot_stats + @pilot_stats = get_registration_stats end private - def get_pilot_stats + def get_registration_stats choices = programme_choices OpenStruct.new({ + cohort:, cip_total: choices.fetch("core_induction_programme", 0), diy_total: choices.fetch("design_our_own", 0), fip_total: choices.fetch("full_induction_programme", 0), @@ -56,7 +57,7 @@ def valid_choices end def cohort - @cohort ||= Cohort.find_by(start_year: 2023) + @cohort ||= Cohort.active_registration_cohort end end end diff --git a/app/views/admin/performance/overview/show.html.erb b/app/views/admin/performance/overview/show.html.erb index fddc0aa88b..418900526f 100644 --- a/app/views/admin/performance/overview/show.html.erb +++ b/app/views/admin/performance/overview/show.html.erb @@ -6,7 +6,7 @@

Overview

- + @@ -51,7 +51,7 @@
Schools registered for 2023 to 2024Schools registered for <%= @pilot_stats.cohort.description %>
Training programme
- +
Participants registered for 2023 to 2024Participants registered for <%= @pilot_stats.cohort.description %>
Participant type