We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c99e16 + 86ddf32 commit 3790856Copy full SHA for 3790856
1 file changed
app/lib/patient_status_updater.rb
@@ -42,16 +42,18 @@ def update_programme_statuses!
42
43
merge_patient_scope(Patient::ProgrammeStatus)
44
.where(academic_year: academic_years)
45
- .includes(
46
- :attendance_record,
47
- :consents,
48
- :patient,
49
- :patient_locations,
50
- :triages,
51
- :vaccination_records,
52
- :parents
53
- )
54
- .find_in_batches do |batch|
+ .in_batches do |relation|
+ batch =
+ relation.includes(
+ :attendance_record,
+ :consents,
+ :patient,
+ :patient_locations,
+ :triages,
+ :vaccination_records,
+ :parents
55
+ ).to_a
56
+
57
batch.each(&:assign)
58
59
Patient::ProgrammeStatus.import!(
0 commit comments