diff --git a/src/db.rs b/src/db.rs index e7af0fdd4..c67eed774 100644 --- a/src/db.rs +++ b/src/db.rs @@ -60,12 +60,15 @@ impl Handler 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::(&conn)?; + let post_list = Post::belonging_to(&thread_result) + .order_by(id.asc()) + .load::(&conn)?; Ok((thread_result, post_list)) }