Skip to content

Instantly share code, notes, and snippets.

@fredjiles
Last active December 14, 2015 02:29
Show Gist options
  • Save fredjiles/5014262 to your computer and use it in GitHub Desktop.
Save fredjiles/5014262 to your computer and use it in GitHub Desktop.
Relationship data doesn't seem to load with ember data REST adapter
App.store = DS.Store.create({
revision:11,
adapter:DS.RESTAdapter.create({ namespace: 'api', bulkCommit:false })
});
App.store.adapter.serializer.primaryKey = function (type) {
return 'name';
};
App.Database = DS.Model.extend({
primaryKey: 'name',
name:DS.attr('string'),
collections: DS.hasMany('App.Collection', {embeded: 'load'})
});
App.Collection = DS.Model.extend({
primaryKey: 'name',
name:DS.attr('string')
});
{
"databases": [
{
"name": "fred",
"collections": [
{
"name": "test collection"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment