Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Giving the faker gem a shot here
- if !User.find_by(email: "example@gmail.com")
- User.create!(email: "example@gmail.com",
- password: "foobar",
- password_confirmation: "foobar")
- end
- 10.times do |n|
- name = Faker::Internet.free_email
- email = "example-#{n+1}@gmail.com"
- password = "password"
- User.create!(
- email: email,
- password: password,
- password_confirmation: password)
- end
- # What is syntax to add in custom terms like "Grass-Fed, pastured, sustainably-raise, organic, etc?"
- users = User.order(:created_at).take(6)
- 10.times do
- message = Faker::Hipster.paragraph
- users.each { |user| user.posts.create!(title: title, message: message, organic: yes, price: price, location: location) }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement