Commit 27e3b47b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix user fixtures for development

parent 8b551ee3
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
(2..20).each do |i| (2..20).each do |i|
begin begin
User.seed(:id, [{ User.create!(
id: i,
username: Faker::Internet.user_name, username: Faker::Internet.user_name,
name: Faker::Name.name, name: Faker::Name.name,
email: Faker::Internet.email, email: Faker::Internet.email,
confirmed_at: DateTime.now confirmed_at: DateTime.now,
}]) password: '12345678'
)
print '.' print '.'
rescue ActiveRecord::RecordNotSaved rescue ActiveRecord::RecordInvalid
print 'F' print 'F'
end end
end end
(1..5).each do |i| (1..5).each do |i|
begin begin
User.seed do |s| User.create!(
s.username = "user#{i}" username: "user#{i}",
s.name = "User #{i}" name: "User #{i}",
s.email = "user#{i}@example.com" email: "user#{i}@example.com",
s.confirmed_at = DateTime.now confirmed_at: DateTime.now,
s.password = '12345678' password: '12345678'
end )
print '.' print '.'
rescue ActiveRecord::RecordNotSaved rescue ActiveRecord::RecordInvalid
print 'F' print 'F'
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment