Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix voting with single election #9097

Merged
merged 1 commit into from May 2, 2022
Merged

Conversation

oriolgual
Copy link
Contributor

馃帺 What? Why?

When there's only one voting enabled, and this voting only has an election, the election is rendered directly.

This was failing because the cell was delegating some methods to the controller, but the controller is trying to load the election from the params.

Instead, we should use the election that's already loaded in the cell.

@oriolgual oriolgual force-pushed the fix-voting-with-single-election branch from 0253923 to 4b211e3 Compare March 26, 2022 18:51
@andreslucena andreslucena added module: elections type: fix PRs that implement a fix for a bug labels Mar 29, 2022
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an spec checking this please? Thanks

@andreslucena andreslucena added the contract: e-voting Barcelona City Council contract label Mar 29, 2022
@oriolgual oriolgual force-pushed the fix-voting-with-single-election branch 2 times, most recently from 09904bf to 6df2cf3 Compare April 24, 2022 10:03
@oriolgual
Copy link
Contributor Author

Done @andreslucena!

Gemfile.lock Outdated Show resolved Hide resolved
The controller will try to load the Election from the params but when
rendering an election that's the single one in a voting there are no
params. Instead, it's better to use the model in the cell.
@oriolgual oriolgual force-pushed the fix-voting-with-single-election branch from 6df2cf3 to 358b7cb Compare May 1, 2022 07:05
@andreslucena andreslucena added this to Technical Review in e-voting May 2, 2022
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ahukkanen ahukkanen merged commit d283907 into develop May 2, 2022
@ahukkanen ahukkanen deleted the fix-voting-with-single-election branch May 2, 2022 14:25
andreslucena pushed a commit that referenced this pull request May 6, 2022
The controller will try to load the Election from the params but when
rendering an election that's the single one in a voting there are no
params. Instead, it's better to use the model in the cell.
andreslucena pushed a commit that referenced this pull request May 6, 2022
The controller will try to load the Election from the params but when
rendering an election that's the single one in a voting there are no
params. Instead, it's better to use the model in the cell.
ahukkanen pushed a commit that referenced this pull request May 10, 2022
The controller will try to load the Election from the params but when
rendering an election that's the single one in a voting there are no
params. Instead, it's better to use the model in the cell.

Co-authored-by: Oriol Gual <oriolgual@users.noreply.github.com>
@andreslucena andreslucena moved this from Technical Review to Done in e-voting May 25, 2022
@alecslupu alecslupu added this to the 0.27.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract: e-voting Barcelona City Council contract module: elections type: fix PRs that implement a fix for a bug
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants