adds poll recounts to dev_seeds

This commit is contained in:
Juanjo Bazán
2017-01-28 19:55:02 +01:00
parent cf6ca50a3b
commit f8d3e645db

View File

@@ -527,7 +527,7 @@ Poll::Booth.all.each do |booth|
end
puts "Creating Poll Officer Assignments"
(1..10).to_a.sample.times do |i|
(1..15).to_a.sample.times do |i|
Poll::BoothAssignment.all.sample(i).each do |booth_assignment|
Poll::OfficerAssignment.create(officer: poll_officer.poll_officer,
booth_assignment: booth_assignment,
@@ -535,6 +535,18 @@ puts "Creating Poll Officer Assignments"
end
end
puts "Creating Poll Recounts" do
(1..15).to_a.sample.times do |i|
poll_officer.poll_officer.officer_assignments.all.sample(i).each do |officer_assignment|
Poll::Recount.create(officer_assignment: officer_assignment,
booth_assignment: officer_assignment.booth_assignment,
date: officer_assignment.date,
count: (1..5000).to_a.sample)
end
end
end
puts "Creating Poll Question from Proposals"
(1..3).each do