Promoting users to TL2 when joining a group - retrospectively?

:warning: This solution is advanced. Rails command can be only done if you have SSH access to your server and should be avoided if you’re not sure of what you’re doing. In any case, always do a backup first.


Hello Richie :slight_smile:

You can use a rails script similar to this:

That should do it from the rails console:

target_group = Group.find_by_name("test")
users = User.joins(:group_users).where(group_users:{group_id: target_group.id})
users.each do |u|
  u.trust_level = 2
  u.save
end

Thanks @nathank for Delete all users not in a specific group - #2 by nathankershaw :slight_smile:

3 Likes