Skip to content

Instantly share code, notes, and snippets.

@AdrienGiboire
Created October 26, 2010 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrienGiboire/647923 to your computer and use it in GitHub Desktop.
Save AdrienGiboire/647923 to your computer and use it in GitHub Desktop.
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
[User, Categorization, Category, Micropost].each(&:delete_all)
User.create({
:username => 'plume',
:email => 'adrien.giboire@gmail.com',
:password => 'adichris',
:password_confirmation => 'adichris'
})
Category.create([
{:title => 'Rails'},
{:title => 'Programming'},
{:title => 'Javascript'},
{:title => 'PHP'},
{:title => 'Frameworks'},
{:title => 'Database'}
])
@microposts = [
{:title => 'Installing MySQL on Snow Leopard using Homebrew', :content => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.' },
{:title => 'Remove a Git Submodule', :content => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.' },
{:title => 'My Git Workflow', :content => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.' },
{:title => 'Dealing with the IE 7 (and 8) Transparency Bug with jQuery', :content => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.' },
{:title => 'Creating a Happy Git Environment on OS X Leopard', :content => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum' },
{:title => 'Setting up a Tracking Branch in Git', :content => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. <script src="http://gist.github.com/647878.js"> </script>' }
]
@categorizations = [
{:category_id => 1, :micropost_id => 1},
{:category_id => 1, :micropost_id => 2},
{:category_id => 2, :micropost_id => 2},
{:category_id => 3, :micropost_id => 2},
{:category_id => 1, :micropost_id => 3},
{:category_id => 2, :micropost_id => 3},
{:category_id => 3, :micropost_id => 4},
{:category_id => 2, :micropost_id => 5},
{:category_id => 5, :micropost_id => 5},
{:category_id => 6, :micropost_id => 5},
{:category_id => 6, :micropost_id => 6}
]
@user = User.first
@microposts.each do |micropost|
@user.microposts.create(micropost)
end
Categorization.create(@categorizations)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment