Created
December 14, 2010 20:06
-
-
Save eqdw/740997 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
namespace :db do | |
desc "Initialize the dev database" | |
task :init_dev => :environment do | |
user = User.find(1) | |
100.times do |i| | |
post = Post.create(:title => "Sample post ##{i+1}", | |
:content => Lorem::Base.new("paragraphs", 2), | |
:user => user, | |
:created_at => "#{rand(3)+2007}/#{rand(12)+1}/#{rand(28)+1}" | |
); | |
post.save! | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment