simplified post disapproval pruning
This commit is contained in:
@@ -12,9 +12,7 @@ class PostDisapproval < ActiveRecord::Base
|
|||||||
scope :disinterest, lambda {where(:reason => ["disinterest", "legacy"])}
|
scope :disinterest, lambda {where(:reason => ["disinterest", "legacy"])}
|
||||||
|
|
||||||
def self.prune!
|
def self.prune!
|
||||||
PostDisapproval.joins(:post).where("posts.is_pending = FALSE AND posts.is_flagged = FALSE and post_disapprovals.created_at < ?", DELETION_THRESHOLD.ago).each do |post_disapproval|
|
PostDisapproval.destroy_all(["created_at < ?", DELETION_THRESHOLD.ago])
|
||||||
post_disapproval.destroy
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_downvote
|
def create_downvote
|
||||||
|
|||||||
Reference in New Issue
Block a user