about summary refs log tree commit diff
path: root/src/db.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-09T21·41+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-09T21·41+0200
commitc5833c02e202f2cbb236a092f851afb117ae2b28 (patch)
treea0c3425a825affb4e31bd7fcbaba724cf56490b2 /src/db.rs
parent103a59485fbb47e44740a976fb846791b8df0802 (diff)
fix(db): Order index threads in descending post time
Technically the last post date should matter more here, but we'll get
there.
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/db.rs b/src/db.rs
index baf404af2a2f..0ff716f708f1 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -30,7 +30,9 @@ impl Handler<ListThreads> for DbExecutor {
         use schema::threads::dsl::*;
 
         let conn = self.0.get()?;
-        let results = threads.load::<Thread>(&conn)?;
+        let results = threads
+            .order(posted.desc())
+            .load::<Thread>(&conn)?;
         Ok(results)
     }
 }