adds spending resolutions to dev_seeds

This commit is contained in:
Juanjo Bazán
2016-01-11 13:45:15 +01:00
parent 3f05864a16
commit 0510d211b3

View File

@@ -183,6 +183,23 @@ end
Flag.flag(flagger, proposal)
end
puts "Creating Spending Proposals"
resolutions = ["accepted", "rejected", nil]
(1..30).each do |i|
author = User.reorder("RANDOM()").first
description = "<p>#{Faker::Lorem.paragraphs.join('</p><p>')}</p>"
spending_proposal = SpendingProposal.create!(author: author,
title: Faker::Lorem.sentence(3).truncate(60),
external_url: Faker::Internet.url,
description: description,
created_at: rand((Time.now - 1.week) .. Time.now),
resolution: resolutions.sample,
terms_of_service: "1")
puts " #{spending_proposal.title}"
end
puts "Creating Legislation"
Legislation.create!(title: 'Participatory Democracy', body: 'In order to achieve...')