Include the answerable by user scope back on Poll list for officer voting panel

This commit is contained in:
Bertocq
2017-10-04 17:05:25 +02:00
parent e1a7fc5dfa
commit 24ef7984a3
2 changed files with 13 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ class Officing::VotersController < Officing::BaseController
def new
@user = User.find(params[:id])
booths = current_user.poll_officer.shifts.current.vote_collection.pluck(:booth_id).uniq
@polls = Poll.current.where(id: Poll::BoothAssignment.where(booth: booths).pluck(:poll_id).uniq)
@polls = Poll.answerable_by(@user).where(id: Poll::BoothAssignment.where(booth: booths).pluck(:poll_id).uniq)
end
def create