aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'planetwars-server/src/db')
-rw-r--r--planetwars-server/src/db/bots.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs
index bef69c0..970dcf9 100644
--- a/planetwars-server/src/db/bots.rs
+++ b/planetwars-server/src/db/bots.rs
@@ -68,3 +68,10 @@ pub fn find_bot_code_bundles(bot_id: i32, conn: &PgConnection) -> QueryResult<Ve
.filter(code_bundles::bot_id.eq(bot_id))
.get_results(conn)
}
+
+pub fn active_code_bundle(bot_id: i32, conn: &PgConnection) -> QueryResult<CodeBundle> {
+ code_bundles::table
+ .filter(code_bundles::bot_id.eq(bot_id))
+ .order(code_bundles::created_at.desc())
+ .first(conn)
+}