Make getAssociationsMap not crash on non-model objects