Skip to content

Commit 990cebf

Browse files
committed
Merge branch 'following-users'
2 parents 06c50c5 + 89ccd48 commit 990cebf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

db/seeds.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@
2626
content = Faker::Lorem.sentence(word_count: 5)
2727
users.each { |user| user.microposts.create!(content: content) }
2828
end
29+
30+
# Create following relationships.
31+
users = User.all
32+
user = users.first
33+
following = users[2..50]
34+
followers = users[3..40]
35+
following.each { |followed| user.follow(followed) }
36+
followers.each { |follower| follower.follow(user) }

0 commit comments

Comments
 (0)