Include no geozone in no demographic data

This commit is contained in:
Javi Martín
2019-04-03 20:02:58 +02:00
parent 383909e16c
commit ae4cd06c24
7 changed files with 46 additions and 15 deletions

View File

@@ -41,8 +41,8 @@ module Statisticable
participants.female.count
end
def total_unknown_gender_or_age
participants.where("gender IS NULL OR date_of_birth is NULL").uniq.count
def total_no_demographic_data
participants.where("gender IS NULL OR date_of_birth IS NULL OR geozone_id IS NULL").count
end
def male_percentage
@@ -153,8 +153,7 @@ module Statisticable
end
def gender_methods
%i[total_male_participants total_female_participants total_unknown_gender_or_age
male_percentage female_percentage]
%i[total_male_participants total_female_participants male_percentage female_percentage]
end
def age_methods
@@ -162,7 +161,7 @@ module Statisticable
end
def geozone_methods
[:participants_by_geozone]
%i[participants_by_geozone total_no_demographic_data]
end
def stats_cache(*method_names)