Created
May 2, 2010 19:26
-
-
Save ccjr/387374 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 5-38. Current Seeds File in db/seeds.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = User.create :email => 'mary@example.com', | |
:password => 'guessit', | |
:password_confirmation => 'guessit' | |
Category.create [{:name => 'Programming'}, | |
{:name => 'Event'}, | |
{:name => 'Travel'}, | |
{:name => 'Music'}, | |
{:name => 'TV'}] | |
user.articles.create :title => 'Advanced Active Record', | |
:body => "Models need to relate to each other. In the real world, ..", | |
:published_at => Date.today | |
user.articles.create :title => 'One-to-many associations', | |
:body => "One-to-many associations describe a pattern ..", | |
:published_at => Date.today | |
user.articles.create :title => 'Associations', | |
:body => "Active Record makes working with associations easy..", | |
:published_at => Date.today |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment