mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 18:13:40 +08:00
Merge pull request #4182 from NickIvanter/fix-best-post
FIX: make sure the best post is not the worst
This commit is contained in:
commit
51b0b5f2f8
|
@ -245,7 +245,7 @@ class Topic < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def best_post
|
||||
posts.order('score desc').limit(1).first
|
||||
posts.order('score desc nulls last').limit(1).first
|
||||
end
|
||||
|
||||
def has_flags?
|
||||
|
|
Loading…
Reference in New Issue
Block a user