fix unit tests
This commit is contained in:
@@ -173,6 +173,7 @@ class FavoriteGroup < ApplicationRecord
|
||||
end
|
||||
|
||||
def add!(post_id)
|
||||
post_id = post_id.id if post_id.is_a?(Post)
|
||||
return if contains?(post_id)
|
||||
|
||||
clear_post_id_array
|
||||
@@ -180,12 +181,14 @@ class FavoriteGroup < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.purge_post(post_id)
|
||||
post_id = post_id.id if post_id.is_a?(Post)
|
||||
for_post(post_id).find_each do |group|
|
||||
group.remove!(post_id)
|
||||
end
|
||||
end
|
||||
|
||||
def remove!(post_id)
|
||||
post_id = post_id.id if post_id.is_a?(Post)
|
||||
return unless contains?(post_id)
|
||||
|
||||
clear_post_id_array
|
||||
|
||||
@@ -13,7 +13,7 @@ class PostDisapproval < ApplicationRecord
|
||||
scope :disinterest, lambda {where(:reason => ["disinterest", "legacy"])}
|
||||
|
||||
def self.prune!
|
||||
PostDisapproval.where("post_id in (select _.post_id from post_disapprovals _ where _.created_at < ?)", DELETION_THRESHOLD.ago)
|
||||
PostDisapproval.where("post_id in (select _.post_id from post_disapprovals _ where _.created_at < ?)", DELETION_THRESHOLD.ago).delete_all
|
||||
end
|
||||
|
||||
def self.dmail_messages!
|
||||
|
||||
Reference in New Issue
Block a user