Skip to content

Commit

Permalink
Fix start_date validation form EditCourseForm
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gms-gs committed Dec 2, 2024
1 parent 7f7f0fa commit 84c05a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/forms/support/edit_course_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 84c05a5

Please sign in to comment.