Fixed updating records with associations attached

Added a step within prepareArguements that reduces all associated
objects to their foreign keys before attempting to update the record in
the DB. This prevents NaN values from being put into the query