You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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).
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 perhapsparent_ids
for a plurality of IDs) that would be extremely helpful. Thanks!The text was updated successfully, but these errors were encountered: