* Removed unapprovals, added post flags and post appeals (still need to update tests)

* Restyled text
This commit is contained in:
albert
2011-03-28 18:48:02 -04:00
parent 42627be1d3
commit f9c961cdc6
66 changed files with 642 additions and 403 deletions

View File

@@ -228,11 +228,15 @@ class User < ActiveRecord::Base
end
def upload_limit
deleted_count = RemovedPost.where("user_id = ?", id).count
unapproved_count = Post.where("is_pending = true and user_id = ?", id).count
deleted_count = Post.for_user(id).deleted.count
pending_count = Post.for_user(id).pending.count
approved_count = Post.where("is_flagged = false and is_pending = false and user_id = ?", id).count
limit = base_upload_limit + (approved_count / 10) - (deleted_count / 4) - unapproved_count
if base_upload_limit
limit = base_upload_limit - pending_count
else
limit = 10 + (approved_count / 10) - (deleted_count / 4) - pending_count
end
if limit > 20
limit = 20