There are two tables, groups, and groups_hierarchy. groups has standard information about a group and the group_hierarchy has two columns (parent, child) that list the parent group's id and child group's id. This is to say that the child group is a subgroup of the parent group. I have been trying to figure out what the associations would be in the GroupHierarchy and Group Data Models. Can someone help me with this?
A group can have many subgroups and it can be a subgroup of many other groups. I figured it would be a has_many :grouphierarchies
in Group and belongs_to :group
in GroupHierarchy but that didn't work...the thing is GroupHierarchy technically belongs to 2 groups.
Thanks