I'm trying to use Ember Data to load a model. The AJAX call to fetch the model seems to be successful but I get the following
Uncaught Error: assertion failed: A data hash was loaded for a model of type App.Account but no primary key 'undefined' was provided.
In ember-data.js:1128 it seems to be deferencing undefined for the primaryKey and not defaulting to 'id' when a model doesn't specify a primaryKey. But I've also tried being explicit with the primaryKey to no effect.
For completeness, here is my model:
App.Account = DS.Model.extend({
portfolio_id: DS.attr('integer'),
title: DS.attr('string'),
user_id: DS.attr('integer'),
url: 'investment_account'
});
and I'm loading the account with the following:
App.store.find(App.Account, account_id)
Any ideas?