Skip to content

Instantly share code, notes, and snippets.

@losingkeys
Last active August 29, 2015 14:04
Show Gist options
  • Save losingkeys/ea20677a362658245d75 to your computer and use it in GitHub Desktop.
Save losingkeys/ea20677a362658245d75 to your computer and use it in GitHub Desktop.
`import DS from 'ember-data'`
ApplicationAdapter = DS.FixtureAdapter.extend()
`export default ApplicationAdapter`
`import DS from 'ember-data'`
MenuItem = DS.Model.extend
name: DS.attr 'string'
description: DS.attr 'string'
price: DS.attr 'number'
menu: DS.belongsTo 'menu'
MenuItem.reopenClass
FIXTURES: [
id: 1
name: 'pizza'
description: 'bread, sauce, and cheese'
price: 10
menu: 1
,
id: 2
name: 'sandwich'
description: 'bread, cheese, and meat'
price: 5
menu: 1
,
id: 3
name: 'tea'
description: 'tea leaves and water'
price: 1
menu: 1
]
`export default MenuItem`
`import DS from 'ember-data'`
Menu = DS.Model.extend
'menu-items': DS.hasMany 'menu-item', { async: yes }
Menu.reopenClass
FIXTURES: [
id: 1
]
`export default Menu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment