I’m looking for some example code to add a user to a group in ruby.
Here is one example:
Here’s the code I ended up with
candidate['groups'].each do |group| if group.user_ids.include?(user.id) then # already a member else group.add user if user.primary_group == nil then user.primary_group = group user.save end end end