This commit is contained in:
r888888888
2017-05-11 15:59:40 -07:00
parent 65999133f2
commit aa5a1eca6f

View File

@@ -13,7 +13,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.destroy_all(["created_at < ?", DELETION_THRESHOLD.ago]) PostDisapproval.where("post_id in (select _.post_id from post_disapprovals _ where _.created_at < ?)", DELETION_THRESHOLD.ago)
end end
def self.dmail_messages! def self.dmail_messages!
@@ -28,7 +28,7 @@ class PostDisapproval < ActiveRecord::Base
Dmail.create_automated( Dmail.create_automated(
:to_id => uploader.id, :to_id => uploader.id,
:title => "Some of your uploads have been critiqued by the moderators", :title => "Someone has commented on your uploads",
:body => message :body => message
) )
end end