Guest User

Untitled

a guest
May 24th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. user = User.create :email => 'mary@example.com',
  2. :password => 'guessit',
  3. :password_confirmation => 'guessit'
  4. Category.create [{:name => 'Programming'},
  5. {:name => 'Event'},
  6. {:name => 'Travel'},
  7. {:name => 'Music'},
  8. {:name => 'TV'}]
  9. user.articles.create :title => 'Advanced Active Record',
  10. :body => "Models need to relate to each other. In the real world, ..",
  11. :published_at => Date.today
  12. user.articles.create :title => 'One-to-many associations',
  13. :body => "One-to-many associations describe a pattern ..",
  14. :published_at => Date.today
  15. user.articles.create :title => 'Associations',
  16. :body => "Active Record makes working with associations easy..",
  17. :published_at => Date.today
Add Comment
Please, Sign In to add comment