seeds.rb 885 B

1234567891011121314151617181920212223242526
  1. # This file should contain all the record creation needed to seed the database with its default values.
  2. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
  3. #
  4. # Examples:
  5. #
  6. # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
  7. # Character.create(name: 'Luke', movie: movies.first)
  8. User.create!(name: "Example User",
  9. login: "example",
  10. email: "example@example.com",
  11. password: "foobar",
  12. password_confirmation: "foobar")
  13. 99.times do |n|
  14. name = Faker::Name.name
  15. email = "example-#{n+1}@example.com"
  16. password = "password"
  17. login = "example_#{n+1}"
  18. User.create!(name: name,
  19. email: email,
  20. login: login,
  21. password: password,
  22. password_confirmation: password)
  23. end