cargo fmt
This commit is contained in:
parent
4323a0cb07
commit
6c7a162f05
@ -290,27 +290,25 @@ mod tests {
|
||||
};
|
||||
|
||||
let db = MockDatabase::new(DbBackend::Postgres)
|
||||
.append_query_results(vec![
|
||||
vec![
|
||||
cake::Model {
|
||||
id: 1,
|
||||
name: "New York Cheese".to_owned(),
|
||||
}.into_mock_row(),
|
||||
cake::Model {
|
||||
id: 2,
|
||||
name: "London Cheese".to_owned(),
|
||||
}.into_mock_row()
|
||||
],
|
||||
])
|
||||
.append_query_results(vec![vec![
|
||||
cake::Model {
|
||||
id: 1,
|
||||
name: "New York Cheese".to_owned(),
|
||||
}
|
||||
.into_mock_row(),
|
||||
cake::Model {
|
||||
id: 2,
|
||||
name: "London Cheese".to_owned(),
|
||||
}
|
||||
.into_mock_row(),
|
||||
]])
|
||||
.into_connection();
|
||||
|
||||
let fruits = vec![
|
||||
fruit::Model {
|
||||
id: 1,
|
||||
name: "Apple".to_owned(),
|
||||
cake_id: Some(1),
|
||||
}
|
||||
];
|
||||
let fruits = vec![fruit::Model {
|
||||
id: 1,
|
||||
name: "Apple".to_owned(),
|
||||
cake_id: Some(1),
|
||||
}];
|
||||
|
||||
let cakes = fruits
|
||||
.load_one(cake::Entity::find(), &db)
|
||||
@ -319,14 +317,10 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
cakes,
|
||||
vec![
|
||||
Some(
|
||||
cake::Model {
|
||||
id: 1,
|
||||
name: "New York Cheese".to_owned(),
|
||||
}
|
||||
)
|
||||
]
|
||||
vec![Some(cake::Model {
|
||||
id: 1,
|
||||
name: "New York Cheese".to_owned(),
|
||||
})]
|
||||
);
|
||||
}
|
||||
|
||||
@ -338,14 +332,12 @@ mod tests {
|
||||
};
|
||||
|
||||
let db = MockDatabase::new(DbBackend::Postgres)
|
||||
.append_query_results(vec![
|
||||
vec![fruit::Model {
|
||||
id: 1,
|
||||
name: "Apple".to_owned(),
|
||||
cake_id: Some(1),
|
||||
}
|
||||
.into_mock_row()],
|
||||
])
|
||||
.append_query_results(vec![vec![fruit::Model {
|
||||
id: 1,
|
||||
name: "Apple".to_owned(),
|
||||
cake_id: Some(1),
|
||||
}
|
||||
.into_mock_row()]])
|
||||
.into_connection();
|
||||
|
||||
let cakes = vec![
|
||||
|
@ -101,12 +101,12 @@ mod base_entity;
|
||||
mod column;
|
||||
mod identity;
|
||||
mod link;
|
||||
mod loader;
|
||||
mod model;
|
||||
/// Re-export common types from the entity
|
||||
pub mod prelude;
|
||||
mod primary_key;
|
||||
mod relation;
|
||||
mod loader;
|
||||
|
||||
pub use active_enum::*;
|
||||
pub use active_model::*;
|
||||
@ -116,6 +116,6 @@ pub use identity::*;
|
||||
pub use link::*;
|
||||
pub use model::*;
|
||||
// pub use prelude::*;
|
||||
pub use loader::*;
|
||||
pub use primary_key::*;
|
||||
pub use relation::*;
|
||||
pub use loader::*;
|
||||
|
@ -141,7 +141,10 @@ async fn loader_load_many() -> Result<(), DbErr> {
|
||||
.expect("Should load bakeries");
|
||||
|
||||
let bakers = bakeries
|
||||
.load_many(baker::Entity::find().filter(baker::Column::Name.like("Baker%")), &ctx.db)
|
||||
.load_many(
|
||||
baker::Entity::find().filter(baker::Column::Name.like("Baker%")),
|
||||
&ctx.db,
|
||||
)
|
||||
.await
|
||||
.expect("Should load bakers");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user