I have setup a test where I try to PUT an item after fetching it. It fails on the dates when PUT'ing though. The date fields below use DS.attr('date').
Versions:
Ember : 1.1.1
Ember Data : 1.0.0-beta.4+canary.c15b8f80
Handlebars : 1.0.0
jQuery : 1.9.1
Here's my code:
BuildingsController
App.BuildingsController = Ember.Controller.extend({
actions: {
createBuilding: function() {
var store = this.get('store');
store.find('building', 1729).then(function(building) {
building.set('title', 'Test 123');
building.save();
});
}
}
});
Data returned from API when calling store.find:
{
"building":{
"id":"1729",
"name":"Test 123",
"sort":"1",
"published_at":"2013-09-26 11:00:27",
"source":"source test",
"content":"<p>content test<\/p>",
"excerpt":"<p>excerpt test<\/p>",
"lat":"62.39039989300704",
"lon":"17.341790199279785",
"address":"address",
"build_start":"2013-09-22",
"build_end":"2013-09-23",
"created_at":"2013-09-26 11:00:28",
"updated_at":"2013-09-26 11:00:28"
}
}
Data PUT to API:
{
"address" : "address",
"build_end" : "Mon, 23 Sep 2013 00:00:00 GMT",
"build_start" : "Sun, 22 Sep 2013 00:00:00 GMT",
"content" : "<p>content test</p>",
"created_at" : "undefined, NaN undefined NaN NaN:NaN:NaN GMT",
"excerpt" : "<p>excerpt test</p>",
"lat" : 62.39039989300704,
"lon" : 17.341790199279785,
"name" : "Test 123",
"published_at" : "undefined, NaN undefined NaN NaN:NaN:NaN GMT",
"sort" : 1,
"source" : "source test",
"updated_at" : "undefined, NaN undefined NaN NaN:NaN:NaN GMT"
}