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

Two Quick Questions David! (RE: Levels, and Multiple Groups) #71

Open
monroemann opened this issue Aug 19, 2018 · 2 comments
Open

Two Quick Questions David! (RE: Levels, and Multiple Groups) #71

monroemann opened this issue Aug 19, 2018 · 2 comments
Labels

Comments

@monroemann
Copy link

Hi David @dwbutler!

Thanks for creating what seems to be a really fantastic gem! I'm working as a volunteer coder with a not-for-profit now called Break Diving, and we are creating a new community site, and I'm hoping you can answer a few questions to help us out!

BACKGROUND INFO: We have five different member levels, and hundreds of different groups, i.e. French, Math, History, etc., and members are all in different locations. Members at different levels will eventually have different permissions, i.e. the higher your level, the more authority you will have on the site. I suppose similar in some ways to the way StackOverFlow works with points. We want to give users points in a way similar to StackOverFlow, and when a point level is reached, upgrade their level.

MY TWO QUESTIONS:

  1. Should we create a 'levels' model, and link that to groupify, or could we easily use groupify to create the different levels? In other words, it seems that the 5 different member levels could perhaps be 5 different groups, and then we could avoid creating a 'levels' model. Am I correct? What would you suggest? Are there downsides to using groupify to create the member levels?

  2. Based on the readme, it seems possible to use groupify to create new groups that combine members of two other groups, for example, could we easily find members who like math, and also those who like science, and add them to a new group called "math-science"? Does the math-science group need to be created in advanced, or could we code it so that groupify only creates the group when there is a 'match'? If so, it would solve our other issue of creating groups of say 'Level 1 - Math', which would find all those in the math group and also those in the level 1 group, and create the new group.

I really hope you can find a quick moment to answer these questions, because we think your gem might be the answer, and would save us a considerable amount of coding time! And best part: you'd be helping a LOT of people by helping us out.

Thank you so much,
-Monroe Mann
Break Diving, Inc.
www.BreakDiving.org

@monroemann monroemann changed the title A Few Quick Questions David! (RE: Levels, and Multiple Groups) Two Quick Questions David! (RE: Levels, and Multiple Groups) Aug 19, 2018
@dwbutler
Copy link
Owner

Hi,

Since there are a finite number of levels, and a user can only exist in one level, maybe a level column on the users table would be sufficient? You could certainly model them as Groupify groups and avoid either a Level model or a level column.

You can always dynamically query for users who belong to multiple groups with the in_all_groups scope. You can always combine the members of two groups into a third group, but the problem is maintaining the new group so it contains any new members added to the original groups. I've done this before with callbacks / service class that, when the user is added to one group, they are also automatically added to another in the same transaction.

@monroemann
Copy link
Author

Thank you David. I am reviewing all of this with my team now. We really appreciate your response. Means a great deal to us.

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

No branches or pull requests

2 participants