Feedback wanted: scored elections#387
Conversation
quintrino
left a comment
There was a problem hiding this comment.
It's looking really well thought out over all.
I'm not sure if you want to address my changes immediately or leave it for a v2.
Let me know.
|
|
||
| has_many :nominations | ||
| has_many :votes, through: :nominations | ||
| has_many :nominated_candidates, through: :nominations, source: :nominee |
There was a problem hiding this comment.
nominated_candidates somewhat rules out if the vote is on something other than an election (ie, if it was about voting on the approval of a new constitutional change )
There was a problem hiding this comment.
I was seeing Election as being specifically about committee member election. Since there are different rules around resolutions and special resolutions, it probably makes sense to have separate models. Instead of belonging to nominations, votes would belong to a polymorphic votable — nominations, resolutions, etc.
There was a problem hiding this comment.
Sure, it's not always going to be a resolution either, ideally it could theoretically be voting on a new mascot or something.
|
|
||
| private | ||
|
|
||
| def top_scoring_candidates |
There was a problem hiding this comment.
So would we have multiple elections/votes for each role?
So I can imagine a separate vote for President, and then a vote for Secretary, but let's assume that we have a general members election and Candidate A is keen to run for both Sponsor Outreach and Diversity Lead, my first thought is to the option to vote for
Candidate A - Sponsor Outreach
Candidate A - Diversity National Lead
and then if they were the highest voted option for both then they would choose which role they wanted.
There was a problem hiding this comment.
My intention with this method returning multiple users is to accommodate both elections for President etc., and the election of ordinary members.
President etc
- election vacancies set to 1, and so
top_scoring_candidatesreturns one user. - one election per position per year / term of office
Ordinary members
- AGM decides by resolution number of ordinary members to hold office, sets election vacancies accordingly
- single election held to fill all vacancies
top_scoring_candidatesreturns number of users required to fill vacancies.
Your scenario is interesting, and possibly I've either misinterpreted the process for ordinary members, or, in "A single election may be held", the word "may" is key. Is it typical to hold an election (ballot) per office to be held by an ordinary member?
In any case, I reckon this scenario of a candidate running for multiple positions could be handled by the candidate withdrawing acceptance for the nomination, and scoping accordingly here.
There was a problem hiding this comment.
So if I'm understanding this correctly if we had 4 open ordinary members this would returns the 4 nominations with the most votes? Would that be in order?
There was a problem hiding this comment.
In that case, there would be 4 vacancies, so this query would get the 4 top scoring nominations (so not necessarily the nominations with the most votes -- e.g. a nomination with 1 vote with a score of 10 beats a nomination with 9 votes with a score of 1).
It then returns the users referenced by the nominations, in no particular order.
And this code path is only invoked if there are more nominations than vacancies (i.e. voting is required).
| t.index ["user_id"], name: "index_memberships_on_user_id" | ||
| end | ||
|
|
||
| create_table "nominations", force: :cascade do |t| |
There was a problem hiding this comment.
I do want us to be able to support votes on things other than Users.
There was a problem hiding this comment.
I think votes would have a polymorphic association in that case (see my other comment).
| # created_at :datetime not null | ||
| # updated_at :datetime not null | ||
| # | ||
| class Election < ApplicationRecord |
There was a problem hiding this comment.
Maybe the Election should have a title of what is being voted on.
There was a problem hiding this comment.
position :string was intended for that, maybe the naming could be improved.
fe9ec7f to
6c055b6
Compare
71ceb7f to
5bd9c8a
Compare
|
Hey team, pushing up what I've got so far, with some failing tests, and visual inconsistencies, as @quintrino is keen to get progress. Help would be appreciated from someone who has more knowledge of Tailwind and the preferred visual language of Ruby Australia than me, as there's a bunch of seemingly inconsistent styles, headings, etc. available. |
This is an incomplete sketch of a how we could model scored elections, per #379.
It seems like there's a lack of consensus as to what form scored voting should take and whether it's something we should build ourselves. And assuming we did build it, there's many ways to go about it.
This approach is informed by the discussion in the issue, and the relevant parts of the constitution (below).
If we do want to proceed along these lines, I can flesh out the validations and build a front end. For now I'd suggest that nominations be collected following the current process and entered using a simple form, and users nominating / consenting to nominations could happen in-app as a later enhancement.