forked from consuldemocracy/consuldemocracy
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix geozone population stats #1939
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8ddc868
to
4369391
Compare
a1e6553
to
42aa13f
Compare
786cb77
to
38e783a
Compare
38f3163
to
c695ca7
Compare
35bd318
to
6c23b41
Compare
6c23b41
to
bbb2b84
Compare
voodoorai2000
approved these changes
Mar 22, 2019
decabeza
approved these changes
Mar 26, 2019
bbb2b84
to
40457b5
Compare
2b22c12
to
1c55447
Compare
e1472be
to
cccf3b2
Compare
We currently don't store geozone population.
Even if this class looks very simple now, we're trying a few things related to these stats. Having a class for it makes future changes easier and, if there weren't any future changes, at least it makes current experiments easier. Note we keep the method `participants_by_geozone` to return a hash because we're caching the stats and storing GeozoneStats objects would need a lot more memory and we would get an error.
decabeza
approved these changes
Apr 4, 2019
If there's demographic data for all participants, it doesn't make sense to show the message. We're using translations instead of an `if` in the view because the text is also different when there's only one participant. In some languages the text might also be different depending on how many people with no demographic data participated. Another possibility would be to use an `if` in the view so we don't display an empty paragraph when the cont is zero, and then using translation for `one` and `other`. I haven't gone that way because I thought the logic would be more complex and the benefits wouldn't be that great.
voodoorai2000
approved these changes
Apr 4, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Objectives
Fix geozone population stats. Currently we calculate the participation percentage related to the registered users from a geozone. However, we need to compare against the geozone population.
Currently, geozones don't store population information. So for polls we won't display this percentage, and for budgets we'll use the information stored in the headings.
Does this PR need a Backport to CONSUL?
Yes, backport when we backport everything related to stats.