-
Notifications
You must be signed in to change notification settings - Fork 10
Description
we have a Team model linked to a Member model though a TeamRole model. In the TeamRole we define "canCreate", "canUpdate", etc. permissions. This is a hasManyThrough relation.
Team <--> TeamRole <--> Member
Next we have a document model, where the author property is a relation (belongsTo) Members, and the team property (belongsTo) Team.
Document.team --> Team
Document.author --> Membe
To query the documents and get the author and team, I perform the following include:
{"include":["author","team"]}
Works great.
Now i want to get the team members at the same time:
{"include":["author",{"team":"members"}]}
Now I have the team with a list of members, but I don't have any data from the TeamRole model.
I tried using the mixin, but without success. Is there a different syntax that I'm not aware of?
attempt 1:
{"include":["author",{"team": "members", "includeThrough":true}]}
attempt 2:
{
"include":{
"relation":"team",
"scope":{
"include":{
"relation":"members"
},
"includeThrough":true
}
}
}
Is your mixing meant to perform this way? Is it possible to get the member roles when including team from another model?