more randomized seed data

This commit is contained in:
albert 2011-09-16 15:39:08 -04:00
parent fa062caea9
commit abbaf7f7ec
2 changed files with 6 additions and 2 deletions

View File

@ -24,7 +24,11 @@ CurrentUser.ip_addr = "127.0.0.1"
if Upload.count == 0
puts "Creating uploads"
1.upto(100) do |i|
url = "http://dummyimage.com/#{i * 10}x400/000/fff"
color1 = rand(4096).to_s(16)
color2 = rand(4096).to_s(16)
width = rand(2000) + 100
height = rand(2000) + 100
url = "http://dummyimage.com/#{width}x#{height}/#{color1}/#{color2}"
tags = (i * i * i).to_s.scan(/./).uniq.join(" ")
Upload.create(:source => url, :content_type => "image/gif", :rating => "q", :tag_string => tags)

View File

@ -3,4 +3,4 @@
rake db:drop db:create
createlang plpgsql danbooru2
rake db:migrate
rake db:seed