diff options
author | Melody Horn <melody@boringcactus.com> | 2021-06-30 15:58:48 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-06-30 15:58:48 -0600 |
commit | b4c7c3cd480e626ac78b49ab91a95340ccfef26a (patch) | |
tree | c1966362001b67b80e8f54a7a9f94be8a47aaf7c /examples/tutorial02/main.rs | |
parent | bdfdcb98d39d1887b08748e1ea629f0a83f340a4 (diff) | |
download | tosin-b4c7c3cd480e626ac78b49ab91a95340ccfef26a.tar.gz tosin-b4c7c3cd480e626ac78b49ab91a95340ccfef26a.zip |
finish inserting save_mut for models
Diffstat (limited to 'examples/tutorial02/main.rs')
-rw-r--r-- | examples/tutorial02/main.rs | 4 |
1 files changed, 2 insertions, 2 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(); |