Remove final result usage on admin poll officer assignments results

This commit is contained in:
Bertocq
2017-09-19 01:13:01 +02:00
parent 1c1bb7bf38
commit a3bf69e78d
15 changed files with 26 additions and 59 deletions

View File

@@ -15,7 +15,7 @@ class Admin::Poll::BoothAssignmentsController < Admin::BaseController
end
def show
@booth_assignment = @poll.booth_assignments.includes(:final_recounts, :voters,
@booth_assignment = @poll.booth_assignments.includes(:total_results, :voters,
officer_assignments: [officer: [:user]]).find(params[:id])
@voters_by_date = @booth_assignment.voters.group_by {|v| v.created_at.to_date}
end

View File

@@ -18,7 +18,7 @@ class Admin::Poll::OfficerAssignmentsController < Admin::BaseController
@officer = ::Poll::Officer.includes(:user).find(officer_assignment_params[:officer_id])
@officer_assignments = ::Poll::OfficerAssignment.
joins(:booth_assignment).
includes(:final_recounts, booth_assignment: :booth).
includes(:total_results, booth_assignment: :booth).
where("officer_id = ? AND poll_booth_assignments.poll_id = ?", @officer.id, @poll.id).
order(:date)
end

View File

@@ -3,7 +3,7 @@ class Admin::Poll::RecountsController < Admin::BaseController
def index
@booth_assignments = @poll.booth_assignments.
includes(:booth, :final_recounts, :voters).
includes(:booth, :total_results, :voters).
order("poll_booths.name").
page(params[:page]).per(50)
end