Allow belongs to associations to be saved when the associated object is null

I was getting the following error message when trying to save a model with a polymorphic belongs to association when the associated object is null:

    TypeError: belongsTo is null

I have added a check to serializePolymorphicType to set the type to null if there is no model associated.