I am having some trouble figuring out how to model self-referential
entities in Rails.
I have a “group” model, which can have 0 or more “group” objects or 0 or
more “user” objects.
I tried creating a subgroup table that has a parent_group_id and a
child_group_id as foreign keys but can’t figure out how to create the
mapping in my ruby model classes. I can’t come up with the correct
parameters for habtm or has_many :through.
I don’t think the acts_as_tree will work for me, because I am really
dealing with a many-to-many self-referential relationship. A group can
be a member of one or more groups, just as a user can be a member of one
or more groups.
Ken
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.