adds automatic recount to admin poll and paginates recounts

This commit is contained in:
Juanjo Bazán
2017-02-14 19:44:19 +01:00
parent 2b68f02b95
commit d68be1f6f0
6 changed files with 37 additions and 7 deletions

View File

@@ -4,4 +4,12 @@ module PollRecountsHelper
recounts.select {|r| r.date == date}.first
end
def booth_assignment_sum_recounts(ba)
ba.recounts.any? ? ba.recounts.to_a.sum(&:count) : nil
end
def booth_assignment_sum_final_recounts(ba)
ba.final_recounts.any? ? ba.final_recounts.to_a.sum(&:count) :nil
end
end