When updating a record the primary key should be removed from the json payload #316

Closed
wants to merge 2 commits into
from
@@ -64,6 +64,7 @@ DS.RESTAdapter = DS.Adapter.extend({
var data = {};
data[root] = record.toJSON();
+ delete data[root][get(record, 'primaryKey')];
this.ajax(this.buildURL(root, id), "PUT", {
data: data,
@@ -158,6 +158,7 @@ test("updating a person makes a PUT to /people/:id with the data hash", function
expectState('dirty');
store.commit();
+ expectData({person: {name: "Brohuda Brokatz"}});
expectState('saving');
expectUrl("/people/1", "the plural of the model name with its ID");