mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
FIX: topic's best post shouldn't be deleted by the author
This commit is contained in:
parent
a1363feec8
commit
6356c0555c
@ -255,7 +255,7 @@ class Topic < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def best_post
|
||||
posts.where(post_type: Post.types[:regular]).order('score desc nulls last').limit(1).first
|
||||
posts.where(post_type: Post.types[:regular], user_deleted: false).order('score desc nulls last').limit(1).first
|
||||
end
|
||||
|
||||
def has_flags?
|
||||
|
Loading…
x
Reference in New Issue
Block a user