daily pastebin goal
90%
SHARE
TWEET

Untitled

a guest Sep 13th, 2017 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### Belongs_to
  2. * Sets up a one-to-one connection with another model
  3. * Such that the model that *belongs_to* is assigned to the other model
  4. * *A book belongs_to an author*
  5. ```rb
  6. class Book
  7.   belongs_to :author
  8. end
  9. ```
  10.  
  11. ### has_one
  12. * Also, is used to set up a one-to-one connection with another model
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top