It seems that JayData EntitySet does not catch property changes when set through Ember like this:
//init at start
controller.set('todo', todoDB.Todos.attachOrGet({ Id:1}));
//later in app
controller.set('todo.Completed', true);
//in the end
todoDB.saveChanges();
I tried this:
controller.todo.save();
But it didnt work!
Then I finally managed with this HACK(?):
var self = this;
mdefs = self.get('todo').getType().memberDefinitions;
for (var name in mdefs) {
if (mdefs[name]
&& mdefs[name].kind == "property"
&& mdefs[name].definedBy == self.todo.getType())
self.todo._setPropertyChanged(mdefs[name]);
}
self.get('todo').save();
So my question is... Is there any pretty(ish) way to do this?
Edit
look at @kingpin2k 's anwer bellow and the comments!
it turns out to be (apparently) only happening with an OData provider (havent tested others). couldnt reproduce with WebSQL.