How to handle inverse of manyThrough relationship?


#1

How would you recommend handling the inverse of manyThrough relationship? Ideally, there would be a belongsThrough relationship but I’m guessing it doesn’t exist for a reason so I appreciate any feedback.

Use case example: User -> Projects -> Tasks

Related question: would it fine to have a task belongTo both a User and a Project or is that some sort of violation of best practices (i.e. since you have to always guarantee task_user_id === project_user_id).


#2

Gone through this http://adonisjs.com/docs/4.0/relationships#_many_through ?


#3

I’m confused, there’s nothing there about handling the inverse of manyThrouh


#4

Maybe you should try explaining what you want to achieve.