瀏覽代碼

Accidentally removed order clause

master
Dylan Baker 2 年之前
父節點
當前提交
64c0eaf641
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1
    0
      lib/search.rb

+ 1
- 0
lib/search.rb 查看文件

@@ -81,6 +81,7 @@ def search_posts(q, username, from_date, to_date, offset, exact_match)
81 81
     .where(Sequel.lit("posts.created_at >= ? OR ? IS NULL", to_date, to_date))
82 82
     .limit(RESULTS_PER_PAGE)
83 83
     .offset(Sequel.lit('?', offset))
84
+    .order(Sequel.desc(Sequel.lit('posts.created_at')))
84 85
 
85 86
   if exact_match
86 87
     query.full_text_search(:body, q, phrase: true, language: 'english')

Loading…
取消
儲存