Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 917 Bytes

answers.md

File metadata and controls

25 lines (13 loc) · 917 Bytes
  1. What is the difference between new and create for a model?

After using "new" to make a new model, one must call "save" to save it into the database.

For "create", new and save is done automatically and the model is saved into the database without calling "save".

  1. What command combined with new will emulate the same behavior as create?

The "save" command

  1. What is the column that exists on every table but we did NOT define?

"id" is the column that exists on every table but we did NOT define. Same with "created_at" and "updated_at".

  1. What single line of ruby code can insert a cat with the name "hat" in the database?

Cat.create name:"hat"

  1. What was the most confusing part over the last few weeks?

Differentiating which files do what in the ruby project folder!

  1. How did you like this homework in comparison with the others?

Fun! Finally get to use database and integrate it with view.