about summary refs log tree commit diff
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/db.rs b/src/db.rs
index e7af0fdd4e..c67eed7745 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -60,12 +60,15 @@ impl Handler<GetThread> for DbExecutor {
 
     fn handle(&mut self, msg: GetThread, _: &mut Self::Context) -> Self::Result {
         use schema::threads::dsl::*;
-
+        use schema::posts::dsl::id;
+        
         let conn = self.0.get()?;
         let thread_result: Thread = threads
             .find(msg.0).first(&conn)?;
 
-        let post_list = Post::belonging_to(&thread_result).load::<Post>(&conn)?;
+        let post_list = Post::belonging_to(&thread_result)
+            .order_by(id.asc())
+            .load::<Post>(&conn)?;
 
         Ok((thread_result, post_list))
     }