Skip to content

Instantly share code, notes, and snippets.

@cloke
Last active December 11, 2015 00:58
Show Gist options
  • Save cloke/4519996 to your computer and use it in GitHub Desktop.
Save cloke/4519996 to your computer and use it in GitHub Desktop.
{ food: {_id: 'bc4', brand: 'test', food_nutrients: [{ _id: 'af1', name: 'sodium'}] }
FoodNutrient = DS.Model.extend({
name: DS.attr( 'string' )
});
Food = DS.Model.extend(
brand: DS.attr( 'string' ),
food_nutrients: DS.hasMany( Diets.FoodNutrient )
});
DS.Adapter.map( FoodNutrient, {
primaryKey: '_id'
});
DS.Adapter.map( Food, {
primaryKey: '_id',
food_nutrients: { embedded: 'always' }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment