Not sure which association best fits what I want. Basically it's a todo list. The list is a task and that task has many users.
ie: Dig a hole and plant some seeds. Digging a hole will require two or more people. Jim and Jo are digging the hole and Jo will plant the seeds after. So two lists to complete, the first by two users and the other by one. Both user can complete both lists if needed.
- Todo: has many lists
- List: belongs to todo
- List: has many users
- User: has many lists
If Im not clear, each task (list) on a todo can be completed by any user. I struggle to see where to put a list_id
on the users table. That's not possible as that user can be doing another (list) at the same time. Im not sure how through: :association
comes into play here.
User.first.lists #= []
Todo.first.lists.first.users #= []
I get nothing as the user_id
needs to go somewhere.