From f8d3e645db6549e5791e0e5abd4863753f9d81d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Sat, 28 Jan 2017 19:55:02 +0100 Subject: [PATCH] adds poll recounts to dev_seeds --- db/dev_seeds.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index 6f10ca891..6541a007b 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -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