From 33138741d971e5d3fd8340ea423ee093c64182f6 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 22 Mar 2013 21:35:46 -0400 Subject: [PATCH] fix base upload limit logic --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 9b0e6c256..aa9b7a4a5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -437,7 +437,7 @@ class User < ActiveRecord::Base pending_count = Post.for_user(id).pending.where("created_at >= ?", 3.days.ago).count approved_count = Post.where("is_flagged = false and is_pending = false and is_deleted = false and uploader_id = ? and created_at >= ?", id, 1.year.ago).count - if base_upload_limit + if base_upload_limit.to_i > 0 limit = [base_upload_limit - (deleted_count / 2), 4].max - pending_count else limit = [10 + [approved_count / 2, 90].min - (deleted_count / 2), 4].max - pending_count