Fix #3534: Remove Janitor Trials.

This commit is contained in:
evazion
2019-11-17 02:05:01 -06:00
parent 1ae971269c
commit 72f17fd1de
19 changed files with 11 additions and 436 deletions

View File

@@ -13,15 +13,9 @@ module ApproverPruner
CurrentUser.scoped(User.system, "127.0.0.1") do
next if user.is_admin?
janitor_trial = JanitorTrial.where(user_id: user.id).first
user.update!(can_approve_posts: false)
user.feedback.create(category: "neutral", body: "Lost approval privileges")
if janitor_trial && user.can_approve_posts?
janitor_trial.demote!
else
user.can_approve_posts = false
user.save
end
Dmail.create_automated(
:to_id => user.id,
:title => "Approver inactivity",

View File

@@ -1,21 +0,0 @@
class JanitorTrialTester
attr_reader :user
def initialize(user_name)
@user = User.find_by_name(user_name)
end
def test
if user.nil?
"User not found"
elsif user.created_at > 1.month.ago
"User signed up within the past month"
elsif user.favorites.count < 100
"User has fewer than 100 favorites"
elsif user.feedback.negative.count > 0
"User has negative feedback"
else
"No issues found"
end
end
end