FIX: digest emails should not include posts that are still in the edit grace period

This commit is contained in:
Neil Lalonde
2017-08-14 12:47:33 -04:00
parent 89e919ec42
commit 94d8f6d734
5 changed files with 148 additions and 117 deletions

View File

@ -99,6 +99,7 @@ class UserNotifications < ActionMailer::Base
.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, ScoreCalculator.default_score_weights[:like_score] * 5.0)
.where('posts.created_at < ?', (SiteSetting.editing_grace_period || 0).seconds.ago)
.limit(SiteSetting.digest_posts)
else
[]