Skip to content

Instantly share code, notes, and snippets.

@crobinson42
Last active October 19, 2015 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crobinson42/40d73b1639a2a20c827d to your computer and use it in GitHub Desktop.
Save crobinson42/40d73b1639a2a20c827d to your computer and use it in GitHub Desktop.
var store = new JSData.DS();
store.registerAdapter('http', new DSHttpAdapter(), { default: true });
var User = store.defineResource({
name : 'user',
bypassCache : true,
relations: {
hasMany: {
item: {
localField: 'items',
foreignKey: 'users'
}
}
}
});
var Item = store.defineResource({
name: 'item',
relations: {
hasMany: {
user: {
localField: 'users',
foreignKey: 'items'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment