Ask A Question
Notifications
You’re not receiving notifications from this thread.
How do I delete orphaned children record from my model.
After a parent model gets deleted it turned out the children became orphaned and I have now added a dependent destroy on the child model to ensure it gets deleted when the parent is deleted. Will updating the foreign key to do an on_delete: :cascade
delete all orphaned children I have in my database on do I have to write a migration to manually get rid of the orphaned children.