BigW Consortium Gitlab

08_wall.rb 360 Bytes
Newer Older
1 2 3
Gitlab::Seeder.quiet do
  (1..300).each  do |i|
    # Random Project
4
    project = Project.all.sample
5 6 7

    # Random user
    user = project.users.sample
8 9 10

    next unless user

11 12 13 14
    user_id = user.id

    Note.seed(:id, [{
      id: i,
15
      project_id: project.id,
16 17 18 19 20 21
      author_id: user_id,
      note: Faker::Lorem.sentence(6)
    }])
    print('.')
  end
end