I use the pedigree in my rails project to create a group hierarchy. A group may belong to a parent group and may have many groups of children. Each group can have many users who belong to the group. The model is as follows:
class Group < ActiveRecord::Base has_ancestry has_many :users end
I would like all users to be available to the descendants of the group, something like this:
class Group < ActiveRecord::Base has_ancestry has_many :users has_many :descendants_users, through: :descendants end
which of course does not work.
Any suggestions?
source share