You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing {patch: true} to a model save, typically Backbone should be sending only the changed attributes to the server. Now when using the backbone_rails_sync.js override, using {patch: true} does not send the changed attributes but sends the entire model to rails. I am guessing during the override, backbone may think that the entire model attributes have been changed, therefore sending those values? When I do not use backbone_rails_sync.js, Backbone sends the proper changed attributes.
The text was updated successfully, but these errors were encountered:
Actually looking at the code it's treating create, update and patch the exact same way.
I suppose that for patch it should be calling changedAttributes instead of calling toJSON for the entire model.
https://github.com/codebrew/backbone-rails/blob/master/vendor/assets/javascripts/backbone_rails_sync.js
When passing
{patch: true}
to a model save, typically Backbone should be sending only the changed attributes to the server. Now when using thebackbone_rails_sync.js
override, using{patch: true}
does not send the changed attributes but sends the entire model to rails. I am guessing during the override, backbone may think that the entire model attributes have been changed, therefore sending those values? When I do not usebackbone_rails_sync.js
, Backbone sends the proper changed attributes.The text was updated successfully, but these errors were encountered: