Let's say I have a user model and a contacts model (contacts contains
name, phone number, email, etc. of people that the user knows). The
models would be
Now let's say I wanted to introduce groups, where the user could place
certain contacts into groups. Some contacts would be in multiple
groups, others wouldn't be in groups at all. What would be the best
way to model this?
I was thinking
But I'm not sure if this really works. How can I guarantee that a
contact in a group really belongs to the user (maybe I can't through
the model and need to do it in code but that seems so unRails like).