0

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 ?

wiri
  • 91
  • 8

0 Answers0