def find(group, *affiliate_ids)
      candidates = self.select { |gm| gm.group.include?(group) }
      return candidates if affiliate_ids.empty?
      candidates.select { |gm| affiliate_ids.detect { |id| gm.include_affiliate?(id) } }
    end
def find(group, *affiliate_ids)
      candidates = self.select { |gm| gm.group.include?(group) }
      return candidates if affiliate_ids.empty?
      candidates.select { |gm| affiliate_ids.detect { |id| gm.include_affiliate?(id) } }
    end
Finds the group memberships that match the given group, possibly
 constrained by one or more affiliates.

 (Note that this method hides the `Enumerable` method `find`.
 You can still use it under its `detect` alias.)

 @param [Group,#to_s] group the group in question or its name
 @param [Array<Object>,nil] *affiliate_ids the affiliates to use to
   constrain the query.

 @return [Array<GroupMembership>]