Simplify finding the booth assignment for a voter

This commit is contained in:
Javi Martín
2023-07-01 21:59:57 +02:00
parent 28a90f05f8
commit 0d35bddf9e

View File

@@ -19,7 +19,7 @@ class Officing::VotersController < Officing::BaseController
poll: @poll, poll: @poll,
origin: "booth", origin: "booth",
officer: current_user.poll_officer, officer: current_user.poll_officer,
booth_assignment: Poll::BoothAssignment.find_by(poll: @poll, booth: current_booth), booth_assignment: current_booth.booth_assignments.find_by(poll: @poll),
officer_assignment: officer_assignment(@poll)) officer_assignment: officer_assignment(@poll))
@voter.save! @voter.save!
end end