From 4843959c7d7742b05892c4208de83f610a697cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 18 Mar 2019 19:34:02 +0100 Subject: [PATCH] Use poll voters valid origins as stats channels They're the same thing, and duplicating them led into a typo saying "mail" instead of "letter". --- app/models/poll/stats.rb | 18 +++++++++--------- config/locales/en/stats.yml | 2 +- config/locales/es/stats.yml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/models/poll/stats.rb b/app/models/poll/stats.rb index 191139d5a..9cc13c726 100644 --- a/app/models/poll/stats.rb +++ b/app/models/poll/stats.rb @@ -2,19 +2,19 @@ class Poll::Stats include Statisticable alias_method :poll, :resource - CHANNELS = %i[web booth mail] + CHANNELS = Poll::Voter::VALID_ORIGINS def self.stats_methods super + %i[total_valid_votes total_white_votes total_null_votes total_participants_web total_web_valid total_web_white total_web_null total_participants_booth total_booth_valid total_booth_white total_booth_null - total_participants_mail total_mail_valid total_mail_white total_mail_null + total_participants_letter total_letter_valid total_letter_white total_letter_null total_participants_web_percentage total_participants_booth_percentage - total_participants_mail_percentage - valid_percentage_web valid_percentage_booth valid_percentage_mail total_valid_percentage - white_percentage_web white_percentage_booth white_percentage_mail total_white_percentage - null_percentage_web null_percentage_booth null_percentage_mail total_null_percentage] + total_participants_letter_percentage + valid_percentage_web valid_percentage_booth valid_percentage_letter total_valid_percentage + white_percentage_web white_percentage_booth white_percentage_letter total_white_percentage + null_percentage_web null_percentage_booth null_percentage_letter total_null_percentage] end def total_participants @@ -57,15 +57,15 @@ class Poll::Stats recounts.sum(:null_amount) end - def total_mail_valid + def total_letter_valid 0 # TODO end - def total_mail_white + def total_letter_white 0 # TODO end - def total_mail_null + def total_letter_null 0 # TODO end diff --git a/config/locales/en/stats.yml b/config/locales/en/stats.yml index 2c64e70b3..df2bd9549 100644 --- a/config/locales/en/stats.yml +++ b/config/locales/en/stats.yml @@ -38,4 +38,4 @@ en: vote_by_channel: "Vote type by channel" web_percentage: "%{percentage} Web" booth_percentage: "%{percentage} Booths" - mail_percentage: "%{percentage} Mail" + letter_percentage: "%{percentage} Mail" diff --git a/config/locales/es/stats.yml b/config/locales/es/stats.yml index 1e6827a97..de363b7e2 100644 --- a/config/locales/es/stats.yml +++ b/config/locales/es/stats.yml @@ -38,4 +38,4 @@ es: vote_by_channel: "Votos emitidos por medio" web_percentage: "%{percentage} Web" booth_percentage: "%{percentage} Urnas" - mail_percentage: "%{percentage} Correo" + letter_percentage: "%{percentage} Correo"