Welcome to mirror list, hosted at ThFree Co, Russian Federation.

05_users.rb « development « fixtures « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b697f58d4ef2a0524c8aba4de0fa11f92b2746b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Gitlab::Seeder.quiet do
  (2..20).each  do |i|
    begin
      User.seed(:id, [{
        id: i,
        username: Faker::Internet.user_name,
        name: Faker::Name.name,
        email: Faker::Internet.email,
        confirmed_at: DateTime.now
      }])
      print '.'
    rescue ActiveRecord::RecordNotSaved
      print 'F'
    end
  end

  (1..5).each do |i|
    begin
      User.seed do |s|
        s.username = "user#{i}"
        s.name = "User #{i}"
        s.email = "user#{i}@example.com"
        s.confirmed_at = DateTime.now
        s.password = '12345678'
      end
      print '.'
    rescue ActiveRecord::RecordNotSaved
      print 'F'
    end
  end
end