diff --git a/src/models/instance.rs b/src/models/instance.rs index 3051516..7d0944f 100644 --- a/src/models/instance.rs +++ b/src/models/instance.rs @@ -43,8 +43,12 @@ impl Instance { .expect("Error saving new instance") } - pub fn get(id: i32) -> Option { - None + pub fn get(conn: &PgConnection, id: i32) -> Option { + instances::table.filter(instances::id.eq(id)) + .limit(1) + .load::(conn) + .expect("Error loading local instance infos") + .into_iter().nth(0) } pub fn block(&self) {}