I’ve modified an existing group and set the Trust level automatically granted to members when they're added value to be 2, so all members of this group will be prompted to Trust Level 2 when added to the group:
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
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
No, that’s just an output that doesn’t have any effect on the script execution. I believe you can press q to leave it.
You can also use this:
It may be related to the Group.find_by_name("test") part. I don’t know if it accepts the actual group name, or slug.
Also, I should have mentioned that using rails commands is fairly advanced and a backup should be made before doing this kind of stuff. I apologize for that.
The task is EnsureDbConsistency and can be triggered through Sidekiq, if you know how to do it. You can also wait a few hours; groups will be updated automatically.
I was just a bit too quick suggesting a rails command without proper warning as it can go bad if we don’t really know what we’re doing. I’ll add a more visible warning to my post