diff --git a/app/models/user.rb b/app/models/user.rb index adce5c8c9..c86cb3300 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -433,7 +433,7 @@ class User < ActiveRecord::Base end def upload_limit - deleted_count = Post.for_user(id).deleted.count + deleted_count = Post.for_user(id).deleted.where("is_banned = false").count pending_count = Post.for_user(id).pending.count approved_count = Post.where("is_flagged = false and is_pending = false and is_deleted = false and uploader_id = ?", id).count diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index aa45b8ce5..e984dc478 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -38,7 +38,7 @@ class UserPresenter return "none" end - deleted_count = Post.for_user(user.id).deleted.count + deleted_count = Post.for_user(user.id).deleted.where("is_banned = false").count pending_count = Post.for_user(user.id).pending.count approved_count = Post.where("is_flagged = false and is_pending = false and is_deleted = false and uploader_id = ?", user.id).count diff --git a/db/migrate/20130323160259_add_hide_deleted_posts_to_users.rb b/db/migrate/20130323160259_add_hide_deleted_posts_to_users.rb index 5f321e0ef..95d59f4d3 100644 --- a/db/migrate/20130323160259_add_hide_deleted_posts_to_users.rb +++ b/db/migrate/20130323160259_add_hide_deleted_posts_to_users.rb @@ -1,5 +1,6 @@ class AddHideDeletedPostsToUsers < ActiveRecord::Migration def change + execute "set statement_timeout = 0" add_column :users, :hide_deleted_posts, :boolean, :null => false, :default => false end end