Last active
December 15, 2015 12:58
-
-
Save marcbowes/5263592 to your computer and use it in GitHub Desktop.
Ember-data: handling temporary data with non-persistent relationships
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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