diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/tutorial02/main.rs | 4 | ||||
-rw-r--r-- | examples/tutorial02/polls/models.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/tutorial02/main.rs b/examples/tutorial02/main.rs index 5d78e5b..785c8f0 100644 --- a/examples/tutorial02/main.rs +++ b/examples/tutorial02/main.rs @@ -45,14 +45,14 @@ mod test { chrono::Local::now().naive_local(), ); // save it - q.save_mut(); + q.save_mut(&connection); // it's got an id now! assert!(q.id().is_some()); // it's still got all the same fields! assert_eq!(q.question_text(), "What's new?"); // we can change them! q.set_question_text("What's up?"); - q.save_mut(); + q.save_mut(&connection); // it should be in the list now, too!! let all_questions = question::table.load::<Question>(&connection).unwrap(); diff --git a/examples/tutorial02/polls/models.rs b/examples/tutorial02/polls/models.rs index 48e58cc..cd480da 100644 --- a/examples/tutorial02/polls/models.rs +++ b/examples/tutorial02/polls/models.rs @@ -17,7 +17,7 @@ pub struct Choice { #[model(max_length = 200)] choice_text: String, #[model(default = 0)] - votes: usize, + votes: i64, } gather!(); |