From 84c05a5aadb72c8d8a186eed6402c416fec739bd Mon Sep 17 00:00:00 2001 From: gms-gs Date: Mon, 2 Dec 2024 13:44:47 +0000 Subject: [PATCH] Fix start_date validation form EditCourseForm We can't pass Structs when updating records in rails 8 any more, we need to pass nil not Struct(day: 1, month: nil, year: nil) when creating or updating records. --- app/forms/support/edit_course_form.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/forms/support/edit_course_form.rb b/app/forms/support/edit_course_form.rb index f702c9bcc9..617a44eb6b 100644 --- a/app/forms/support/edit_course_form.rb +++ b/app/forms/support/edit_course_form.rb @@ -80,8 +80,8 @@ def assign_attributes_to_course attributes = { course_code:, name:, - start_date:, - applications_open_from:, + start_date: valid_date?(:start_date) ? start_date : nil, + applications_open_from: valid_date?(:applications_open_from) ? applications_open_from : nil, is_send: send?, can_sponsor_student_visa:, can_sponsor_skilled_worker_visa: