Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Belongs_to
- * Sets up a one-to-one connection with another model
- * Such that the model that *belongs_to* is assigned to the other model
- * *A book belongs_to an author*
- ```rb
- class Book
- belongs_to :author
- end
- ```
- ### has_one
- * Also, is used to set up a one-to-one connection with another model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement