change report time range to match actual upload formula

This commit is contained in:
r888888888
2015-09-23 14:06:58 -07:00
parent 1ad8e82c70
commit 8b3b2d18c8

View File

@@ -38,14 +38,14 @@ module Reports
end
def self.deletion_confidence_interval_for(user, days = nil)
date = (days || 30).days.ago
date = (days || 120).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
ci_lower_bound(deletions, total)
end
def self.negative_score_confidence_interval_for(user, days = nil)
date = (days || 30).days.ago
date = (days || 120).days.ago
hits = Post.where("created_at >= ? and score < 0", date).where(:uploader_id => user.id).count
total = Post.where("created_at >= ?", date).where(:uploader_id => user.id).count
ci_lower_bound(hits, total)