Skip to content

Instantly share code, notes, and snippets.

@QuintinAdam
Last active August 29, 2015 14:06
Show Gist options
  • Save QuintinAdam/e5ac77c3bfaf0e0e4bfc to your computer and use it in GitHub Desktop.
Save QuintinAdam/e5ac77c3bfaf0e0e4bfc to your computer and use it in GitHub Desktop.
user = User.find_or_create_by!(email: "[email protected]") do |user|
user.password= '12345678'
user.password_confirmation= '12345678'
end
puts "created #{user.email}"
25.times do
photo = open("http://placekitten.com/g/#{Random.rand(300..600)}/#{Random.rand(300..600)}")
photo = user.pictures.create(title: 'Awesome Cat', description: 'Awesome Cat Description', photo: photo, category: 'Cat')
puts "created cat photo for #{user.email}"
end
user = User.find_or_create_by!(email: "[email protected]") do |user|
user.password= '12345678'
user.password_confirmation= '12345678'
end
puts "created #{user.email}"
25.times do
photo = open("http://420placehold.it/meme/#{Random.rand(300..600)}-#{Random.rand(300..600)}")
photo = user.pictures.create(title: 'Awesome Memes', description: 'Awesome Memes Description', photo: photo, category: 'Memes')
puts "created meme photo for #{user.email}"
end
user = User.find_or_create_by!(email: "[email protected]") do |user|
user.password= '12345678'
user.password_confirmation= '12345678'
end
puts "created #{user.email}"
25.times do
photo = open("http://lorempixel.com/#{Random.rand(300..600)}/#{Random.rand(300..600)}/food/")
photo = user.pictures.create(title: 'Awesome Food', description: 'Awesome Food Description', photo: photo, category: 'Food')
puts "created food photo for #{user.email}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment