Revert "Revert "update unsetAssociations to also unset the database refe...

...rence held by ModelWithId""

This reverts commit 9b43bbb575e6d46d22e38510d540d104b03752fd.