toasty_driver_integration_suite/scenarios/
company_office_address.rs1use crate::prelude::*;
2
3scenario! {
4 #[derive(Debug, toasty::Model)]
5 struct Company {
6 #[key]
7 #[auto]
8 id: uuid::Uuid,
9
10 name: String,
11
12 headquarters: Office,
13 }
14
15 #[derive(Debug, toasty::Embed)]
16 struct Office {
17 name: String,
18 address: Address,
19 }
20
21 #[derive(Debug, toasty::Embed)]
22 struct Address {
23 street: String,
24 city: String,
25 }
26
27 async fn setup(test: &mut Test) -> toasty::Db {
28 test.setup_db(models!(Company)).await
29 }
30}