forked from e621ng/e621ng
more randomized seed data
This commit is contained in:
parent
fa062caea9
commit
abbaf7f7ec
@ -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)
|
||||
|
@ -3,4 +3,4 @@
|
||||
rake db:drop db:create
|
||||
createlang plpgsql danbooru2
|
||||
rake db:migrate
|
||||
|
||||
rake db:seed
|
||||
|
Loading…
Reference in New Issue
Block a user