upload limits: refactor deletion confidence calculation.

This commit is contained in:
evazion
2020-01-13 12:53:44 -06:00
parent 0b08f38b8b
commit 85676ddb74
2 changed files with 7 additions and 18 deletions

View File

@@ -1,10 +0,0 @@
module Reports
class UserPromotions
def self.deletion_confidence_interval_for(user, days = nil)
date = (days || 60).days.ago
deletions = Post.where("created_at >= ?", date).where(:uploader_id => user.id, :is_deleted => true).count
total = Post.where("created_at >= ?", date).where(:uploader_id => user.id).count
DanbooruMath.ci_lower_bound(deletions, total)
end
end
end