mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-23 18:40:34 +00:00
Implement models::instance::Instance::get
This commit is contained in:
parent
f060fa08af
commit
4036d5771c
1 changed files with 6 additions and 2 deletions
|
@ -43,8 +43,12 @@ impl Instance {
|
||||||
.expect("Error saving new instance")
|
.expect("Error saving new instance")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get(id: i32) -> Option<Instance> {
|
pub fn get(conn: &PgConnection, id: i32) -> Option<Instance> {
|
||||||
None
|
instances::table.filter(instances::id.eq(id))
|
||||||
|
.limit(1)
|
||||||
|
.load::<Instance>(conn)
|
||||||
|
.expect("Error loading local instance infos")
|
||||||
|
.into_iter().nth(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn block(&self) {}
|
pub fn block(&self) {}
|
||||||
|
|
Loading…
Reference in a new issue