Add cumulative totals to admin poll recounts list
This commit backports commit AyuntamientoMadrid@90638672 and the changes that code has been through: * AyuntamientoMadrid@03371a71 removed daily recounts in the controller * AyuntamientoMadrid@fe3492a7 removed daily recounts in the view * AyuntamientoMadrid@aa59d995 replaced FinalRecount with TotalResult * AyuntamientoMadrid@c40e8d79 replaced TotalResult with Recount
This commit is contained in:
committed by
Javi Martín
parent
b96e2d4510
commit
26d1024cfc
@@ -6,6 +6,10 @@ class Admin::Poll::RecountsController < Admin::Poll::BaseController
|
||||
includes(:booth, :recounts, :voters).
|
||||
order("poll_booths.name").
|
||||
page(params[:page]).per(50)
|
||||
@all_booths_counts = {
|
||||
final: ::Poll::Recount.select(:total_amount).where(booth_assignment_id: @poll.booth_assignment_ids).sum(:total_amount),
|
||||
system: ::Poll::Voter.where(booth_assignment_id: @poll.booth_assignment_ids).count
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user