Merge pull request #3525 from BrokenEagle/fix-index-default-order
Fix index default order
This commit is contained in:
@@ -515,6 +515,11 @@ class PostQueryBuilder
|
||||
when "rank"
|
||||
relation = relation.order("log(3, posts.score) + (extract(epoch from posts.created_at) - extract(epoch from timestamp '2005-05-24')) / 35000 DESC")
|
||||
|
||||
when "custom"
|
||||
if q[:post_id].present? && q[:post_id][0] == :in
|
||||
relation = relation.find_ordered(q[:post_id][1])
|
||||
end
|
||||
|
||||
else
|
||||
relation = relation.order("posts.id DESC")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user