Updating only necessary properties when setting attributes of a model