In Ruby on Rails, how can you model a situation where an Employee
may belong to a Section
and that Section
may or may not belong to another Section
all the way up to Organization
. I am looking for a set of models that can handle an unknown number of levels. And then finding out the most immediate level an Employee
is in, and each Section
would have it's own admin(s).
I hope to use acl9 for authorization, but still can't figure out how this would be done if the number of levels is unknown.
The ancestry gem sounds like it might do what you are looking for. There's a railscast on it as well: http://railscasts.com/episodes/262-trees-with-ancestry