Skip to content

Instantly share code, notes, and snippets.

@cloke
Forked from fredjiles/response
Last active December 14, 2015 02:39
Show Gist options
  • Save cloke/5015047 to your computer and use it in GitHub Desktop.
Save cloke/5015047 to your computer and use it in GitHub Desktop.
DS.RESTAdapter.map('App.Database', {
primaryKey: 'name'
collections: { embedded: 'load' }
});
DS.RESTAdapter.map('App.Collection', {
primaryKey: 'name'
});
App.store = DS.Store.create({
revision:11,
adapter:DS.RESTAdapter.create({ namespace: 'api', bulkCommit:false })
});
App.Database = DS.Model.extend({
name:DS.attr('string'),
collections: DS.hasMany('App.Collection')
});
App.Collection = DS.Model.extend({
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