Last active
December 14, 2015 02:29
-
-
Save fredjiles/5014262 to your computer and use it in GitHub Desktop.
Relationship data doesn't seem to load with ember data REST adapter
This file contains hidden or 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
App.store = DS.Store.create({ | |
revision:11, | |
adapter:DS.RESTAdapter.create({ namespace: 'api', bulkCommit:false }) | |
}); | |
App.store.adapter.serializer.primaryKey = function (type) { | |
return 'name'; | |
}; | |
App.Database = DS.Model.extend({ | |
primaryKey: 'name', | |
name:DS.attr('string'), | |
collections: DS.hasMany('App.Collection', {embeded: 'load'}) | |
}); | |
App.Collection = DS.Model.extend({ | |
primaryKey: 'name', | |
name:DS.attr('string') | |
}); |
This file contains hidden or 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
{ | |
"databases": [ | |
{ | |
"name": "fred", | |
"collections": [ | |
{ | |
"name": "test collection" | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment