create officer assignments in order

Make sure we create the Poll::OfficerAssignments in the same order the
booth_assignments where previously created. So the spec "Poll::Shift
officer_assignments creates and destroy corresponding
officer_assignments does" not fail.
This commit is contained in:
Julian Herrero
2018-11-23 18:15:47 +01:00
parent 46b66e9376
commit c563f73189

View File

@@ -24,7 +24,7 @@ class Poll
end
def create_officer_assignments
booth.booth_assignments.each do |booth_assignment|
booth.booth_assignments.order(:id).each do |booth_assignment|
attrs = {
officer_id: officer_id,
date: date,