lundi 29 décembre 2014

How to define multiple hasMany relationships of same(parent) type on model?

I want to define multiple hasMany relationships on Ember Data model of parent type, but I don't have a clue how to specify inverses for this:



Profile = DS.Model.extend
# ...
friends: DS.hasMany 'profile', async: true
observed: DS.hasMany 'profile', async: true
observers: DS.hasMany 'profile', async: true


It would be easy for me to handle such properties in database, however Ember Data doesn't support this. Is this possible to have this 3 hasMany relationships defined without creating another models (eg. Friend, Observer).


Error I'm getting:



Error: Assertion Failed: You defined the 'friends' relationship on app@model:profile:, but multiple possible inverse relationships of type app@model:profile: were found on app@model:profile:. Look at http://emberjs.com/guides/models/defining-models/#toc_explicit-inverses for how to explicitly specify inverses






Aucun commentaire:

Enregistrer un commentaire