Skip to content

Commit 05cb872

Browse files
committed
Show administration time of vaccinations on the activity log
Not the creation time of the record, that can potentially be years afterwards.
1 parent d68ad38 commit 05cb872

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/components/app_activity_log_component.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def vaccination_events
120120

121121
{
122122
title:,
123-
time: vaccination_record.created_at,
123+
time:
124+
vaccination_record.administered_at || vaccination_record.created_at,
124125
notes: vaccination_record.notes,
125126
by: vaccination_record.performed_by&.full_name
126127
}

spec/components/app_activity_log_component_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
:vaccination_record,
9494
programme:,
9595
patient_session:,
96-
created_at: Time.zone.parse("2024-05-31 12:00"),
96+
administered_at: Time.zone.parse("2024-05-31 12:00"),
9797
performed_by: user,
9898
notes: "Some notes"
9999
)
@@ -102,7 +102,7 @@
102102
:vaccination_record,
103103
programme:,
104104
patient_session:,
105-
created_at: Time.zone.parse("2024-05-31 13:00"),
105+
administered_at: Time.zone.parse("2024-05-31 13:00"),
106106
performed_by: nil,
107107
notes: "Some notes",
108108
vaccine: create(:vaccine, :gardasil, programme:)

0 commit comments

Comments
 (0)