Created
April 5, 2012 17:24
-
-
Save mkocher/2312675 to your computer and use it in GitHub Desktop.
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
Species = DS.Model.extend({ | |
name: DS.attr('string') | |
}); | |
Person = DS.Model.extend({ | |
name: DS.attr('string'), | |
species: DS.belongsTo(Species, { embedded: true }) | |
tags: DS.hasMany(Tag, { embedded: true }) | |
}); | |
person = store.load(Person,1,{id:1, species:{id:1, name:"Human"}}); | |
machine = store.load(Species,2,{id:2, name:"Machine"}); | |
// person.getPath('species.name') === "Human" | |
person.set('species', machine); | |
// person.getPath('species.name') === undefined | |
// should === "Machine" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment