Class: Workarea::CustomersSeeds

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Testing::TimeHelpers
Defined in:
app/seeds/workarea/customers_seeds.rb

Instance Method Summary collapse

Instance Method Details

#performObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/seeds/workarea/customers_seeds.rb', line 7

def perform
  puts 'Adding customers...'

  20.times do |i|
    travel_to rand(12).weeks.ago

    User.create!(
      email: Faker::Internet.email,
      password: Faker::Internet.password,
      first_name: Faker::Name.first_name,
      last_name: Faker::Name.last_name
    )

    travel_back
  end
end