Display the same results for stats and recounts

In the recounts we were incorrectly assuming the total amount included
the blank and invalid ballots.
This commit is contained in:
Javi Martín
2019-05-30 13:58:31 +02:00
parent 6881ee134a
commit 123196e4ed
4 changed files with 9 additions and 11 deletions

View File

@@ -93,6 +93,10 @@ class Poll::Stats
super + total_unregistered_booth
end
def total_registered_booth
voters.where(origin: "booth").count
end
private
def participant_ids
@@ -107,10 +111,6 @@ class Poll::Stats
@recounts ||= poll.recounts
end
def total_registered_booth
voters.where(origin: "booth").count
end
def total_unregistered_booth
[total_participants_booth - total_registered_booth, 0].max
end