Browse Source

Fix sort column names in search query

master
Dylan Baker 4 years ago
parent
commit
27cafd6b40
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      lib/search.rb

+ 3
- 3
lib/search.rb View File

@@ -12,11 +12,11 @@ def search(params)
12 12
     sort =
13 13
       case params[:sort]
14 14
       when 'thread'
15
-        'threads.created_at DESC'
15
+        'created_at DESC'
16 16
       when 'post'
17
-        'posts.created_at DESC'
17
+        'last_post_created_at DESC'
18 18
       else
19
-        'threads.created_at DESC'
19
+        'created_at DESC'
20 20
       end
21 21
     search_threads(db, query, username, sort, offset)
22 22
   when 'posts'

Loading…
Cancel
Save