Skip to content

Instantly share code, notes, and snippets.

@marcbowes
Last active December 15, 2015 12:58
Show Gist options
  • Save marcbowes/5263592 to your computer and use it in GitHub Desktop.
Save marcbowes/5263592 to your computer and use it in GitHub Desktop.
Ember-data: handling temporary data with non-persistent relationships
{
tops: [{
hostname: "hostname",
load: 10,
processes: [{
name: "ruby",
RSS: 20000
}]
}]
}
/*
This feels like we have the following models:
host:
hostname: string
load: integer
processes: hasMany 'process'
process:
name: string
RSS: integer
host: belongsTo 'host'
But how do we link these up given that there are no ids?
I could fake it (e.g. autoincrement when generating the data), but I'm wondering if there is another way?
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment