Model w/belongsTo has reference, but hasMany does not. Can I complete the relationship?


#1
App.Asset = DS.Model.extend({
  name: DS.attr('string'),
  contract: DS.hasMany('contract', { async: true })
});

App.Contract = DS.Model.extend({
   asset: DS.belongsTo('asset')
})

Asset Data:

{ "assets" : [{ "id" : 1, "name": "Foo"}]}

Contract Data:

{ "contracts": [{ "id" : 1000, "asset" : 1 }]}

In the Chrome Ember development plugin the contract correctly associates to the asset, but the asset points to a PromiseArray that never resolves.

Logically it seems like everything is there for that relationship to resolve. Is there a way I can prod it along?

I tried creating a computed property in the Contract model that would set a reference to itself using its own Asset reference but I ran into async problems (the asset wasn’t available when the computed property tried to calculate).