Aaron Renoir
Aaron Renoir

Reputation: 4391

my computed values stopped working with latest version of ember-data.js

I am getting the following error when i change attributes of a model.

Uncaught Error: <DS.StateManager:ember466> could not respond to event setProperty in state rootState.loading.

Here is the code. http://jsfiddle.net/arenoir/JejwD/ http://jsfiddle.net/arenoir/JejwD/show

Upvotes: 1

Views: 416

Answers (1)

Dan Gebhardt
Dan Gebhardt

Reputation: 3281

Since revision 6 of ember-data (see breaking changes), IDs are string-normalized. As a result, you'll need to update your fixtures to use strings for IDs (note: the REST adapter will convert numbers/strings, but the fixture adapter doesn't do any conversions).

Making the following changes to your fixtures seems to get your example working:

App.Address.FIXTURES = [
    {id: '1', streetnumber: '1018', streetname: '4th Ave', city: 'Oakland', state: 'Ca'} 
];

App.Job.FIXTURES = [
    {id: '1', address_id: '1', customer_id: '1', name: 'bathroom addition', rate: "310", hours: "1000"}
];

App.Customer.FIXTURES = [
    {id: '1', firstname: 'Mike', lastname: 'Smith', jobs: ['1']}
];

See http://jsfiddle.net/dgeb/GVU7n/

Upvotes: 8

Related Questions