Notes in Clean Up Inactive Users test

category = Category.where(id: 8).pluck(:id)  #31 is the id of my local category I'm deleting for testing
topic = Topic.where(category_id: category).pluck(:id)

topic.each do |t|
  Post.where(topic_id: t).find_each do |p|
    PostDestroyer.new(Discourse.system_user, p).destroy
    p.destroy! 
  end
end

user = User.where(username: 'Test_Eleven')
user.update(created_at: "2023-10-25 00:00:00.00000")
user = User.where(username: 'Test_Eleven')
user.update(last_seen_at: "2023-10-25 01:00:00.00000")


user = User.where(username: 'Test_Thirteen')
user.update(last_seen_at: "2023-10-25 01:00:00.00000")

Get to trust level 1 by…

  • Entering at least 5 topics
  • Reading at least 30 posts
  • Spend a total of 10 minutes reading posts