updates dev seeds with poll questions from proposals

This commit is contained in:
rgarcia
2016-11-18 20:39:02 +01:00
parent b48ee1c7a2
commit 5894a169d6

View File

@@ -405,6 +405,18 @@ end
Poll::Booth.create(name: "Booth #{i}", poll: Poll.all.sample)
end
puts "Creating Poll Question from Proposals"
(1..3).each do |i|
proposal = Proposal.reorder("RANDOM()").first
poll = Poll.current.first
question = Poll::Question.create(valid_answers: "Yes, No")
question.copy_attributes_from_proposal(proposal)
question.save!
puts " #{question.title} (from proposal)"
end
puts "Commenting Poll Questions"
(1..30).each do |i|