Reputation: 6128
How to make Ember-Data to recognize multiple many-to-many relationships between the models?
User
export default DS.Model.extend({
groups: DS.hasMany('group')
});
Group
export default DS.Model.extend({
members: DS.hasMany('user'),
inactive_members: DS.hasMany('user')
});
The error
You defined the 'groups' relationship on frontend@model:user:, but multiple possible inverse relationships of type frontend@model:user: were found on frontend@group:.
Upvotes: 1
Views: 78
Reputation: 161
You need to explicitly set the inverse on the User model as follows:
groups: DS.hasMany('group', { inverse: 'members' })
Upvotes: 1