mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
|
end
|
||||||
|
|
||||||
def best_post
|
def best_post
|
||||||
posts.order('score desc').limit(1).first
|
posts.order('score desc nulls last').limit(1).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_flags?
|
def has_flags?
|
||||||
|
Loading…
Reference in New Issue
Block a user