diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-11-21 23:19:05 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-11-21 23:19:05 +0100 |
commit | beede75cefd5ae52c2d81b7f183cfa41953b09a4 (patch) | |
tree | c2ff6e0a2f98083474ac7856f48413ce07820fae /src | |
parent | f6b3c1a3a1fd1eddeb7e87262d56ae9dbdb47ac1 (diff) | |
download | rocket-blog-beede75cefd5ae52c2d81b7f183cfa41953b09a4.tar.gz rocket-blog-beede75cefd5ae52c2d81b7f183cfa41953b09a4.tar.bz2 rocket-blog-beede75cefd5ae52c2d81b7f183cfa41953b09a4.zip |
Derive FromForm for models::Post.
This allows us to pass in forms that will translate into proper form
objects.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 3 | ||||
-rw-r--r-- | src/models.rs | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1,3 +1,6 @@ +#![feature(plugin, custom_derive)] +#![plugin(rocket_codegen)] + #[macro_use] extern crate diesel_codegen; pub mod models; diff --git a/src/models.rs b/src/models.rs index a0152c0..d8aa0aa 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,4 +1,4 @@ -#[derive(Default, Serialize, Queryable)] +#[derive(Debug, Default, FromForm, Serialize, Queryable)] pub struct Post { pub id: i32, pub title: String, |