Skip to content

Commit d616eb5

Browse files
committed
Add microposts to seeds
1 parent cb07d28 commit d616eb5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

db/seeds.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@
1919
activated: true,
2020
activated_at: Time.zone.now)
2121
end
22+
23+
# Generate microposts for a subset of users.
24+
users = User.order(:created_at).take(6)
25+
50.times do
26+
content = Faker::Lorem.sentence(word_count: 5)
27+
users.each { |user| user.microposts.create!(content: content) }
28+
end

0 commit comments

Comments
 (0)