Files
danbooru/app/logical/reports/user_promotions.rb
evazion 917ffa87ed users: remove score confidence intervals from /users index.
These were originally used to find uploaders with high-scoring uploads
for promotion purposes. The weekly reports generated by Reportbooru are
better suited for this.

Also clean up some unused and redundant code.
2020-01-02 01:44:03 -06:00

11 lines
406 B
Ruby

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