fix error #2408
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
class JanitorPruner
|
class JanitorPruner
|
||||||
def inactive_janitors
|
def inactive_janitors
|
||||||
admin = User.admins.first
|
|
||||||
|
|
||||||
User.where("level = ?", User::Levels::JANITOR).select do |user|
|
User.where("level = ?", User::Levels::JANITOR).select do |user|
|
||||||
approval_count = Post.where("created_at >= ? and approver_id = ?", 2.months.ago, user.id).count
|
approval_count = Post.where("created_at >= ? and approver_id = ?", 2.months.ago, user.id).count
|
||||||
approval_count == 0
|
approval_count == 0
|
||||||
@@ -9,6 +7,8 @@ class JanitorPruner
|
|||||||
end
|
end
|
||||||
|
|
||||||
def prune!
|
def prune!
|
||||||
|
admin = User.admins.first
|
||||||
|
|
||||||
inactive_janitors.each do |user|
|
inactive_janitors.each do |user|
|
||||||
CurrentUser.scoped(admin, "127.0.0.1") do
|
CurrentUser.scoped(admin, "127.0.0.1") do
|
||||||
Dmail.create_split(
|
Dmail.create_split(
|
||||||
|
|||||||
Reference in New Issue
Block a user