Advertisement
Guest User

Untitled

a guest
May 10th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  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. password = "ktrubisz123"
  9.  
  10. 500.times do |i|
  11. user = User.create(
  12. email: Faker::Internet.email,
  13. password: password,
  14. password_confirmation: password
  15. ).save!
  16. end
  17.  
  18. 500.times do |i|
  19. user = User.create(
  20. title: Faker::Book.title,
  21. director: Faker::Book.author,
  22. year: Faker::Number.between(1970, 2017),
  23. description: FFaker::Lorem.paragraphs,
  24. photo: Faker::File.file_name('path/to')
  25. ).save!
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement