From 709eb44ccb8d08ad7f26cdac2932eadc7ccd48e7 Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Fri, 18 Jun 2021 10:12:16 -0600 Subject: make model metadata available in AppConfig --- examples/tutorial02/polls/mod.rs | 1 + examples/tutorial02/polls/models.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/tutorial02') diff --git a/examples/tutorial02/polls/mod.rs b/examples/tutorial02/polls/mod.rs index 0b039d9..1968d5a 100644 --- a/examples/tutorial02/polls/mod.rs +++ b/examples/tutorial02/polls/mod.rs @@ -9,5 +9,6 @@ pub use urls::urls; pub const APP: AppConfig = AppConfig { name: module_path!(), + models: models::ALL, migrations: migrations::migrations, }; diff --git a/examples/tutorial02/polls/models.rs b/examples/tutorial02/polls/models.rs index 5ed52c5..fb8be8f 100644 --- a/examples/tutorial02/polls/models.rs +++ b/examples/tutorial02/polls/models.rs @@ -1,4 +1,4 @@ -use tosin::db::models::{Model, Id}; +use tosin::db::models::{Model, Id, gather}; #[derive(Model)] pub struct Question { @@ -19,3 +19,5 @@ pub struct Choice { #[model(default = 0)] votes: usize, } + +gather!(); -- cgit v1.2.3