rails/rails — pull request #5413 by jsl (2012-03-13 16:28:30+00:00)
Title: Fix bug where nested deletes could invalidate parent object

ActiveRecord allowed nested models to be deleted in update_attributes
using the _destroy parameter even when this made the parent invalid.
This commit adds tests for the correct behavior, and fixes the problem
by checking if the parent is valid before commiting the transaction.

Thanks to @itsmeduncan for pair programming on this bug fix.