Browse Source

Fix sort column names in search query

master
Dylan Baker 5 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
     sort =
12
     sort =
13
       case params[:sort]
13
       case params[:sort]
14
       when 'thread'
14
       when 'thread'
15
-        'threads.created_at DESC'
15
+        'created_at DESC'
16
       when 'post'
16
       when 'post'
17
-        'posts.created_at DESC'
17
+        'last_post_created_at DESC'
18
       else
18
       else
19
-        'threads.created_at DESC'
19
+        'created_at DESC'
20
       end
20
       end
21
     search_threads(db, query, username, sort, offset)
21
     search_threads(db, query, username, sort, offset)
22
   when 'posts'
22
   when 'posts'

Loading…
Cancel
Save