100.years.ago -> Time.at(0)

A bit more robust ;)
This commit is contained in:
Henrik Nyh 2017-09-19 08:48:50 +01:00 committed by GitHub
parent a5408650bd
commit 77cc33b231
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class Post < ActiveRecord::Base
scope :for_mailing_list, ->(user, since) {
q = created_since(since)
.joins(:topic)
.where(topic: Topic.for_digest(user, 100.years.ago)) # we want all topics with new content, regardless when they were created
.where(topic: Topic.for_digest(user, Time.at(0))) # we want all topics with new content, regardless when they were created
q = q.where.not(post_type: Post.types[:whisper]) unless user.staff?