adds valuator and assignments to dev_seeds
This commit is contained in:
@@ -41,6 +41,9 @@ admin.create_administrator
|
||||
moderator = create_user('mod@madrid.es', 'mod')
|
||||
moderator.create_moderator
|
||||
|
||||
valuator = create_user('valuator@madrid.es', 'valuator')
|
||||
valuator.create_valuator
|
||||
|
||||
(1..10).each do |i|
|
||||
org_name = Faker::Company.name
|
||||
org_user = create_user("org#{i}@madrid.es", org_name)
|
||||
@@ -247,8 +250,6 @@ end
|
||||
|
||||
puts "Creating Spending Proposals"
|
||||
|
||||
resolutions = ["accepted", "rejected", nil]
|
||||
|
||||
(1..30).each do |i|
|
||||
geozone = Geozone.reorder("RANDOM()").first
|
||||
author = User.reorder("RANDOM()").first
|
||||
@@ -258,12 +259,17 @@ resolutions = ["accepted", "rejected", nil]
|
||||
external_url: Faker::Internet.url,
|
||||
description: description,
|
||||
created_at: rand((Time.now - 1.week) .. Time.now),
|
||||
resolution: resolutions.sample,
|
||||
geozone: [geozone, nil].sample,
|
||||
terms_of_service: "1")
|
||||
puts " #{spending_proposal.title}"
|
||||
end
|
||||
|
||||
puts "Creating Valuation Assignments"
|
||||
|
||||
(1..17).to_a.sample.times do
|
||||
SpendingProposal.reorder("RANDOM()").first.valuators << valuator.valuator
|
||||
end
|
||||
|
||||
puts "Creating Legislation"
|
||||
|
||||
Legislation.create!(title: 'Participatory Democracy', body: 'In order to achieve...')
|
||||
|
||||
Reference in New Issue
Block a user