FIX: summary email popular posts ordering by score, and increase minimum score to qualify as popular

This commit is contained in:
Neil Lalonde 2016-12-07 12:40:44 -05:00
parent d379f57c58
commit ad5d16af8e
1 changed files with 3 additions and 3 deletions

View File

@ -136,11 +136,11 @@ class UserNotifications < ActionMailer::Base
@other_new_for_you = topics_for_digest.size > SiteSetting.digest_topics ? topics_for_digest[SiteSetting.digest_topics..-1] : []
@popular_posts = if SiteSetting.digest_posts > 0
Post.for_mailing_list(user, min_date)
Post.order("posts.score DESC")
.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")
.where("posts.post_number > ? AND posts.score > ?", 1, ScoreCalculator.default_score_weights[:like_score] * 5.0)
.limit(SiteSetting.digest_posts)
else
[]