this is ember rc1 master as of march 25, and ember-data rev 12. i can't get a Model's hasMany to sideload - that sideloaded data doesn't materialize in the store. using the default RESTAdapter.
App.AssetLinkGroup = DS.Model.extend({
asset_links : DS.Model.hasMany('App.AssetLink')
})
App.AssetLink = DS.Model.extend({
asset_link_group : DS.Model.belongsTo('App.AssetLinkGroup')
})
the json i'm returning from the server for App.AssetLinkGroup.find(5) is as follows (with a lot of the basic attributes like name/date/etc removed for brevity)
{
"asset_link_group": {
"asset_link_ids": [154,155],
"asset_links": [
{
id : 154,
"asset_link_group_id": 5
},
{
id : 155,
"asset_link_group_id": 5
}
]
}
}
App.AssetLinkGroup.find(5) successfully loads the AssetLinkGroup model from the server. but the AssetLinks don't seem to get materialized in the store. when i try an App.AssetLink.all() .content, it shows an empty array.
furthermore if i try:
var algroup5 = App.AssetLinkGroup.find(5);
algroup5.get('asset_links');
it makes a findMany call to the server which shows me it definitely doesn't have these records in the store.
why aren't the AssetLink records materializing in the store when i load AssetLinkGroup?