Todos without projects
When a project is deleted using an action such as UsersController::destroy, the user instance gets destroyed and propagates deletion to related projects. However, the todos of this project do not get deleted as there is a :delete_all dependency between users and projects.
- Ivan
- Ivan
Leave a comment
Looks like it. Users -> :delete_all Projects, and Projects -> :delete_all Todos, but when a User is destroyed :delete_all does not propagate further than the deleted user's projects. The dependency between Users and Projects would have to be :destroy_all, but I'm not suggesting that as a fix as that may break other things (possibly deleting too eagerly)
true. Need to investigate why we reverted to delete_all from destroy_all. Perhaps performance was an issue, but deleting a user is not really done often IMHO.
Ref: http://stackoverflow.com/questions/2797339/rails-dependent-destroy-vs-dependent-delete-all
Ref: http://stackoverflow.com/questions/2797339/rails-dependent-destroy-vs-dependent-delete-all
Migrated to GitHub issue #1447