Project

General

Profile

Patch #23328 » create_test_members.rb

Go MAEDA, 2024-01-03 02:10

 
1
projects = Project.where(id: [1])
2
prefix = 'testuser'
3

    
4
5000.times do |i|
5
  login = sprintf("#{prefix}%05d", i)
6
  user = User.create!(:mail => "#{login}@example.com", :login => login, :firstname => login, :lastname => login)
7
  projects.each do |p|
8
    Member.create!(:principal => user, :project => p, :role_ids => [1])
9
  end
10
end
(5-5/7)