I guess all is in the title, but I have an additional question.
Is there a list of Discourse rails commands somewhere? I remember seeing one, but I won’t find it.
Probably, but I don’t think this is good practice because you might end up spamming out emails to unverified addresses.
myInactiveUsers = User.where(active: false)
myInactiveUsers.each do |myInactiveUser|
myInactiveUser.active = true
myInactiveUser.save!
end
The above script should work, but I’m not sure if there would be additional unintended side-effects (functionally), use at your own risk!
This is just Active Record Basics — Ruby on Rails Guides
And knowing the basic objects that Discourse maintains, in this case the User model.
The models are here: https://github.com/discourse/discourse/tree/master/app/models
Thanks for the reply
It’s just out of curiosity after reading this thread.
I won’t test the code myself and since you’re not sure that were won’t be any side-effect, I can’t check the solution button.
Thanks for the links!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.