2012-11-13 21:11:56 +01:00
|
|
|
UsersProject.skip_callback(:save, :after, :update_repository)
|
|
|
|
|
2012-12-27 04:14:05 +01:00
|
|
|
Gitlab::Seeder.quiet do
|
|
|
|
|
|
|
|
(1..300).each do |i|
|
|
|
|
# Random Project
|
|
|
|
project = Project.scoped.sample
|
|
|
|
|
|
|
|
# Random user
|
|
|
|
user = User.not_in_project(project).sample
|
|
|
|
|
|
|
|
next unless user
|
|
|
|
|
|
|
|
UsersProject.seed(:id, [{
|
|
|
|
id: i,
|
|
|
|
project_id: project.id,
|
|
|
|
user_id: user.id,
|
|
|
|
project_access: UsersProject.access_roles.values.sample
|
|
|
|
}])
|
|
|
|
|
|
|
|
print('.')
|
|
|
|
end
|
|
|
|
end
|
2011-12-04 21:19:49 +01:00
|
|
|
|
2012-11-13 21:11:56 +01:00
|
|
|
UsersProject.set_callback(:save, :after, :update_repository)
|
2011-12-04 21:19:49 +01:00
|
|
|
|
2012-11-13 21:11:56 +01:00
|
|
|
puts "\nRebuild gitolite\n".yellow
|
|
|
|
Project.all.each(&:update_repository)
|
|
|
|
puts "OK".green
|