assemblymade/coderwall — pull request #236 by YaroSpace (2014-10-27 14:59:19+00:00)
Title: Bug delete user #398

Bounty: [BUG: After deleting a user/protip Coderwall will generate a 404 on the logged in home](https://assembly.com/coderwall/bounties/398)

Simple fix, but took ages to figure out.

For some reason (please somebody tell me why) `has_many :protips, dependent: delete_all` deletes all protips associated with a user, but does not trigger `after_destroy` or any other callbacks on protips deletion. I have tried `dependent: :destroy, destroy_all' - no effect, so just added a `before_destroy` callback for the User model.