0
votes

I'm trying to update my model with ember-data like this (jsBin):

App = Ember.Application.create({
  ready: function() {
    var post = App.Post.find(1);
    post.one('didLoad', function() {
      post.set('name', 'my new name');
      post.save();
    });
  }
});

App.Store = DS.Store.extend({
  revision: 12,
  adapter: DS.FixtureAdapter
});

App.Post = DS.Model.extend({
  name: DS.attr('string')
});

App.Post.FIXTURES = [
  {id: '1', name: 'first post'}
];

and I get the following error in Chrome:

Uncaught Error: Attempted to handle event `didCommit` on <App.Post:ember226:1> while in state rootState.loaded.updated.uncommitted. Called with undefined

Is there something wrong or this is a bug ?

I can't reproduce this error with the latest revision of ember data. Can you try to update ember data? - Cyril Fluck
It works updating ember-data :) - Costent
I'm having this same issue. I'm currently using r12 of Ember Data, isn't that the most current? Here's the code I'm using. gist.github.com/commadelimited/5674041 - commadelimited