rails/rails — pull request #5248 by jcoleman (2012-03-02 21:21:18+00:00)
Title: Unset association when existing record is destroyed.

To avoid foreign key errors (and invalid data) in the database, when a belongs_to association is destroyed, it should also be nil'd out on the parent object.

That is, the association id should not be kept on the record after save. This is a corruption of data integrity in the database.