From 5110527a646b0cb275dd8ac8cb55a8a965b98b05 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Tue, 24 Sep 2024 12:03:56 +0100 Subject: [PATCH] Show started at Update the admin ui to show the claim started_at time rather than claim created_at time --- app/helpers/admin/claims_helper.rb | 2 +- db/migrate/20240924113642_make_claims_started_at_not_null.rb | 5 +++++ db/schema.rb | 4 ++-- .../admin_view_full_claim_further_education_payments_spec.rb | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20240924113642_make_claims_started_at_not_null.rb diff --git a/app/helpers/admin/claims_helper.rb b/app/helpers/admin/claims_helper.rb index 8c099e60ce..d01366f027 100644 --- a/app/helpers/admin/claims_helper.rb +++ b/app/helpers/admin/claims_helper.rb @@ -54,7 +54,7 @@ def admin_student_loan_details(claim) def admin_submission_details(claim) [ - [translate("admin.started_at"), l(claim.created_at)], + [translate("admin.started_at"), l(claim.started_at)], [translate("admin.submitted_at"), l(claim.submitted_at)], [translate("admin.decision_deadline"), l(claim.decision_deadline_date)], [translate("admin.decision_overdue"), decision_deadline_warning(claim)] diff --git a/db/migrate/20240924113642_make_claims_started_at_not_null.rb b/db/migrate/20240924113642_make_claims_started_at_not_null.rb new file mode 100644 index 0000000000..11346759df --- /dev/null +++ b/db/migrate/20240924113642_make_claims_started_at_not_null.rb @@ -0,0 +1,5 @@ +class MakeClaimsStartedAtNotNull < ActiveRecord::Migration[7.0] + def change + change_column_null :claims, :started_at, false + end +end diff --git a/db/schema.rb b/db/schema.rb index 888b71090c..2aa35382cd 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: 2024_09_24_095435) do +ActiveRecord::Schema[7.0].define(version: 2024_09_24_113642) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_trgm" @@ -111,7 +111,7 @@ t.text "onelogin_idv_first_name" t.text "onelogin_idv_last_name" t.date "onelogin_idv_date_of_birth" - t.datetime "started_at", precision: nil + t.datetime "started_at", precision: nil, null: false t.index ["academic_year"], name: "index_claims_on_academic_year" t.index ["created_at"], name: "index_claims_on_created_at" t.index ["eligibility_type", "eligibility_id"], name: "index_claims_on_eligibility_type_and_eligibility_id" diff --git a/spec/features/admin/admin_view_full_claim_further_education_payments_spec.rb b/spec/features/admin/admin_view_full_claim_further_education_payments_spec.rb index 69a2f869a3..efe9ae062b 100644 --- a/spec/features/admin/admin_view_full_claim_further_education_payments_spec.rb +++ b/spec/features/admin/admin_view_full_claim_further_education_payments_spec.rb @@ -26,7 +26,7 @@ address_line_4: "Oregon", postcode: "AB12 3CD", email_address: "edna.krabappel@springfield-elementary.edu", - created_at: DateTime.new(2024, 8, 1, 9, 0, 0), + started_at: DateTime.new(2024, 8, 1, 9, 0, 0), submitted_at: DateTime.new(2024, 8, 1, 11, 0, 0), academic_year: AcademicYear.new(2024) )