dwbutler / groupify

Add group and membership functionality to your Rails models
MIT License
194 stars 42 forks source link

nesting groups inside groups #55

Open eyalrosen opened 7 years ago

eyalrosen commented 7 years ago

Hi, Is it possible to nest groups inside groups? Thanks

dwbutler commented 7 years ago

This is not currently possible out of the box. Supporting this would be very complex. What use case do you have in mind?

You can make a group a member of another group. But this does not affect group membership.

eyalrosen commented 7 years ago

I need to develop an app in hierarchical groups (School > Department > Class)

dwbutler commented 7 years ago

I would recommend using an excellent gem such as Closure Tree to store the hierarchy. And then add some business logic in your application that adds the user to the parent groups when they are added to a group. (And removes them from the parent groups when they are removed.)

eyalrosen commented 7 years ago

Thanks!

dwbutler commented 7 years ago

@eyalrosen I'm curious to know what your solution was. It's a common question and it would be great to document solutions in the readme.

eyalrosen commented 7 years ago

still checking it out, I'll keep you updated :)

monroemann commented 6 years ago

@eyalrosen Did you ever find a solution to your issue? I'm interested in the same functionality.