Association doesn't resolve client side


#1

Hi,

I’m loading a Match and sideloading a bunch of games. Here’s part of my game model:

export default DS.Model.extend({ mset: DS.belongsTo('mset'), server: DS.belongsTo('user'), winner: DS.belongsTo('user'), points: DS.hasMany('point'), nr: DS.attr('number'), And the findRecord:

return this.store.findRecord('match', params.match_id, { include: "p1,p2,msets,msets.games,msets.games.winner" });

It works well for the most part, but it’s not resolving the Winner

Only when I completely embed them in the server response to they get set in Ember. But I don’t want that, because the winner is always either player 1 or player 2 which should, or will be, known in the Store because they are embedded in the Match response. Plus, later on I will have a winner for each point, and their could be hundreds of points for one Match, I want those referenced by ID, not be embedded in the server’s JSON response.

Hmmm, it’s hard to write this question down. Basically I know the winner-id, I have the winner (User instance) already in the Store, but still Ember does’t set game.winner. Should Ember be able to do that?

I’m using DS.JSONAPIAdapter