Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-associate "role" with project (role in project) rather than with the user resource itself #93

Open
JohnRDOrazio opened this issue Sep 10, 2021 · 2 comments

Comments

@JohnRDOrazio
Copy link
Collaborator

JohnRDOrazio commented Sep 10, 2021

Considering that a user could theoretically participate in more than one project with a different role

CASE:

  1. a bride creates her wedding booklet on this website
  2. she is satisfied with the experience, and invites a friend of hers to make their booklet on the website
  3. the friend would like her to help out, and adds her as a guest to the wedding booklet project
  4. the initial bride would have role "bride" on her own booklet project, but role "guest" on her friend's booklet project

This means that the user "role" should probably not be associated with the user resource itself (as is currently the case), but should be an association between a user and a project. I'm guessing a kind of a join table? We have (at least in theory) a join table between users and projects. Perhaps a "user role" field could be added to this same join table?

@JohnRDOrazio
Copy link
Collaborator Author

Perhaps this would require using a :has_many => through association rather than a has_and_belongs_to_many association? See here.

@JohnRDOrazio
Copy link
Collaborator Author

here is a little bit of info on an example of a join table with extra attributes: https://blog.codedge.io/rails-join-table-with-extra-attributes/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant