From 126be6c4784c161ff39ea8ff32542bcdf4233d2c Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Fri, 21 Dec 2018 17:37:32 +0100 Subject: [PATCH] FIX: Resetting bump date shouldn't fail when first post is hidden --- app/models/topic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/topic.rb b/app/models/topic.rb index d9ad81b9e58..0afa508bf9d 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -1357,7 +1357,7 @@ class Topic < ActiveRecord::Base user_deleted: false, hidden: false, post_type: Post.types[:regular] - ).last + ).last || first_post update!(bumped_at: post.created_at) end