Hello,
I would like to clarify the following part of the documentation:
Update must return a Deferred that resolves to an object that contains any properties that should be set on the instance.
I have a model with default values for some attributes.
The problem is that after model update I don't return all attribute values in response, only required (time stamp etc...) and my current attribute values are replaced with default values.
For example I have a model with attribute 'a' and default value for that attribute is 100. I set the value to 90 and call model save that performs update operation. On update I return some attributes and 'a' is not there.
After update I have my 'a' attribute set to 100 again.
After looking into code I found that if attributes from server are supplied then 'model' method is called and new model instance with default attribute values is created. The created instance is then used to update current model instance replacing current values with defaults.
I think the behavior is incorrect and default attribute values should not be applied.
I would like to clarify the following part of the documentation:
Update must return a Deferred that resolves to an object that contains any properties that should be set on the instance.
I have a model with default values for some attributes.
The problem is that after model update I don't return all attribute values in response, only required (time stamp etc...) and my current attribute values are replaced with default values.
For example I have a model with attribute 'a' and default value for that attribute is 100. I set the value to 90 and call model save that performs update operation. On update I return some attributes and 'a' is not there.
After update I have my 'a' attribute set to 100 again.
After looking into code I found that if attributes from server are supplied then 'model' method is called and new model instance with default attribute values is created. The created instance is then used to update current model instance replacing current values with defaults.
I think the behavior is incorrect and default attribute values should not be applied.