File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
app/controllers/api/testing Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,9 @@ def destroy
59
59
log_destroy ( Consent . where ( team :) )
60
60
log_destroy ( Triage . where ( team :) )
61
61
62
- Patient
63
- . where ( id : patient_ids )
64
- . includes ( :parents )
65
- . in_batches { log_destroy ( it ) }
62
+ log_destroy ( ParentRelationship . where ( patient_id : patient_ids ) )
63
+ log_destroy ( Patient . where ( id : patient_ids ) )
64
+ log_destroy ( Parent . where . missing ( :parent_relationships ) )
66
65
67
66
batches = Batch . where ( team :)
68
67
log_destroy ( VaccinationRecord . where ( batch : batches ) )
@@ -101,7 +100,7 @@ def destroy
101
100
def log_destroy ( query )
102
101
where_clause = query . where_clause
103
102
@log_time ||= Time . zone . now
104
- query . destroy_all
103
+ query . delete_all
105
104
response . stream . write (
106
105
"#{ query . model . name } .where(#{ where_clause . to_h } ): #{ Time . zone . now - @log_time } s\n "
107
106
)
You can’t perform that action at this time.
0 commit comments