* Remove unused `ban` and `without_mod_action` options. * Don't try to set the `is_banned` flag during deletion. * Don't create modactions for automatic "unapproved in 3 days" deletions, only to delete them after the fact.
21 lines
442 B
Ruby
21 lines
442 B
Ruby
class PostPruner
|
|
def prune!
|
|
prune_pending!
|
|
prune_flagged!
|
|
end
|
|
|
|
def prune_pending!
|
|
Post.pending.expired.each do |post|
|
|
post.delete!("Unapproved in three days", user: User.system)
|
|
end
|
|
end
|
|
|
|
def prune_flagged!
|
|
Post.flagged.each do |post|
|
|
if post.flags.unresolved.old.any?
|
|
post.delete!("Unapproved in three days after returning to moderation queue", user: User.system)
|
|
end
|
|
end
|
|
end
|
|
end
|