Apply changes when a model is saved