From c563f731899643ae28a286ed2d1aef125ec0e53d Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Fri, 23 Nov 2018 18:15:47 +0100 Subject: [PATCH] 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. --- app/models/poll/shift.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/poll/shift.rb b/app/models/poll/shift.rb index e3cfd2280..d9803f237 100644 --- a/app/models/poll/shift.rb +++ b/app/models/poll/shift.rb @@ -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,