How to recalculate all trust_levels?

AI-generated summary

The discussion centers on recalculating all trust levels for users after changes have been made to the trust level requirements. satonotdead initially looked for a rake command but found it no longer functions, seeking a method to recalculate trust levels based on updated parameters.

JammyDodger first suggested a Meta Discourse thread, but acknowledged it might not be the perfect solution. Later, JammyDodger provided a solution from the Discourse blog post (post 1), involving running rails c with commands to recalculate promotions for all users (User.all.find_each do |user| Promotion.recalculate(user) end) and then ensure group consistency (Group.ensure_consistency!).

satonotdead confirmed the issue was solved by a similar workaround.

There was a rake jobs:recalculate_trust_level_for_all_users, but it doesn’t seem to work anymore.

Is there a method to recalculate all trust levels with ‘updated’ parameters?

I changed the requirements of all of them, but users still remain on their previous trust level granted.

How about this method?

No. Perhaps not precisely what you’re after. :thinking:

Thanks Jammy, it’s not what I’m looking for but I ended doing something similar.

The issue is solved by workarounds :slight_smile:

I couldn’t see the wood for the trees at first, but this is the one I was thinking of: