hide deleted posts in tag subscriptions/favorites

This commit is contained in:
r888888888
2013-05-13 10:45:33 -07:00
parent 6f8271c412
commit e3493f6cd3
2 changed files with 11 additions and 1 deletions

View File

@@ -124,7 +124,13 @@ class TagSubscription < ActiveRecord::Base
end
def self.find_posts(user_id, name = nil, limit = Danbooru.config.tag_subscription_post_limit)
Post.where(["id in (?)", find_post_ids(user_id, name, limit)]).order("id DESC").limit(limit)
arel = Post.where(["id in (?)", find_post_ids(user_id, name, limit)])
if CurrentUser.user.hide_deleted_posts?
arel = arel.where("is_deleted = false")
end
arel.order("id DESC").limit(limit)
end
def self.process_all