emberjs/data — pull request #45 by kyptin (2012-01-17 18:03:43+00:00)
Title: Error when committing a newly created record

When creating a record and calling commit on the store, I get the
following error:

Uncaught TypeError: Object (subclass of DS.State) has no method 'enter'

Here is some code that exhibits this error:

window.App = Ember.Application.create();

App.store = DS.Store.create({
adapter: DS.Adapter.create({
createRecord: function() {
console.log('created record');
}
}),
});

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

App.store.createRecord(App.Person, {name: 'Jeff T.'});
App.store.commit();

The problem was that we were attempting to enter a state class, rather
than a state instance. This was caused by calling `DS.State.extend()`
within another `DS.State.extend()` call.