Extract method to get stats participant_ids

This way we can share the `participants` method between budget and poll
stats.
This commit is contained in:
Javi Martín
2019-04-04 18:30:52 +02:00
parent 944bd2d418
commit 1f4707facd
3 changed files with 10 additions and 6 deletions

View File

@@ -33,6 +33,10 @@ module Statisticable
participants.where(geozone: geozones).any?
end
def participants
User.where(id: participant_ids)
end
def total_male_participants
participants.male.count
end