Skip to content

Instantly share code, notes, and snippets.

@ccjr
Created May 2, 2010 19:26
Show Gist options
  • Save ccjr/387374 to your computer and use it in GitHub Desktop.
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
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