Merge pull request #4182 from NickIvanter/fix-best-post

FIX: make sure the best post is not the worst
This commit is contained in:
Régis Hanol 2016-04-19 18:48:15 +02:00
commit 51b0b5f2f8

View File

@ -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?