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

Feature request: multiple parents #37

Open
brandondrew opened this issue Sep 14, 2024 · 1 comment
Open

Feature request: multiple parents #37

brandondrew opened this issue Sep 14, 2024 · 1 comment

Comments

@brandondrew
Copy link

I have a use case (a university web site) where I must model supervisor/employee relationships.

These are essentially parent/child relationships, except that anyone can have an arbitrary number of appointments and therefore an arbitrary number of supervisors (though in practice more than 3 is rare). (Think of a professor whose specialty cuts across the boundaries of linguistics and anthropology, or chemistry and biology, etc. If they are also a department chair, then they likely have 3 appointments, and thus report to 3 different people.)

If acts_as_recursive_tree could support a parent_id which is an array or JSONB column (or perhaps parent_ids for a plurality of IDs) that would be extremely helpful. Thanks!

@wollistik
Copy link
Collaborator

This sounds very interesting 🤔. I can think of specifying directly an Arel node as parent_id with some additional configuration.
But honestly I don't know if I will add this here or rethink the whole gem, since there is now built in support for recursive CTEs in Rails 7.2 (see https://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-with_recursive).

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

2 participants