Steps to reproduce
a Doctor has many Patients through Appointment, the relation called patients.
Doctor : [{id: 1, dec: 'doctor'}]
Appointment: [{doctorId: 1, patientId: 1}, {doctorId: 1, patientId: 2}]
Patient: [{id: 1, name: 'p1'}, {id: 2, name: 'p2'}]
Current Behavior
// delete all patients that belongs to doctor id 1 where the patient name is p2
doctorRepo.patients(1).delete({name: 'p2'});
The target p2 gets deleted, but patient p1 is no longer traversable as the through model Appointment{doctorId: 1, patientId: 1} gets deleted too.
Expected Behavior
Should delete the related through models instead of deleting all throughs that belong to the same source key.
Acceptance Criteria