def replace_constituent_group!(old_group_id, new_group_attrs)
      # first, check to see if this group exists.
      group = get_constituent_group(old_group_id)
      raise "Group being renamed does not exist!" if group.nil?

      cons_ids  = get_cons_ids_for_group(old_group_id)
      delete_constituent_groups(old_group_id)

      new_group = find_or_create(new_group_attrs)
      add_cons_ids_to_group(new_group.id, cons_ids)

      new_group
    end
def replace_constituent_group!(old_group_id, new_group_attrs)
      # first, check to see if this group exists.
      group = get_constituent_group(old_group_id)
      raise "Group being renamed does not exist!" if group.nil?

      cons_ids  = get_cons_ids_for_group(old_group_id)
      delete_constituent_groups(old_group_id)

      new_group = find_or_create(new_group_attrs)
      add_cons_ids_to_group(new_group.id, cons_ids)

      new_group
    end
Warning: this is an expensive, potentially dangerous operation! You should almost always use rename group instead.