Created
October 10, 2018 01:57
-
-
Save polyglotdev/8861d22f6ed702dcfc5064fbb1560cec to your computer and use it in GitHub Desktop.
seeds.db
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
require 'random_data' | |
50.times do | |
Post.create!( | |
title: RandomData.random_sentence, | |
body: RandomData.random_paragraph | |
) | |
end | |
posts = Post.all | |
100.times do | |
Comment.create!( | |
post: posts.sample, | |
body: RandomData.random_paragraph | |
) | |
end | |
puts 'Seed finished' | |
puts '#{Post.count} posts created' | |
puts '#{Comment.count} comments created' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment