FIX: summary should not include certain post types

This commit is contained in:
Neil Lalonde
2016-12-01 12:01:23 -05:00
parent 69ff0e48b4
commit 985daf5c72
2 changed files with 25 additions and 2 deletions

View File

@@ -137,6 +137,8 @@ class UserNotifications < ActionMailer::Base
@popular_posts = if SiteSetting.digest_posts > 0
Post.for_mailing_list(user, min_date)
.where('posts.post_type = ?', Post.types[:regular])
.where('posts.deleted_at IS NULL AND posts.hidden = false AND posts.user_deleted = false')
.where("posts.post_number > ? AND posts.score > ?", 1, 5.0)
.order("posts.score DESC")
.limit(SiteSetting.digest_posts)