add update_attributes method for model