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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow supporting investments on more than one heading per group #2546

Merged
merged 6 commits into from
Mar 22, 2018

Conversation

voodoorai2000
Copy link
Member

@voodoorai2000 voodoorai2000 commented Mar 22, 2018

References

Issue: #2320
Backport: AyuntamientoMadrid#1382
Related: #2547

Objectives

Allow users to support in multiple headings of a single group by changing the maxium number of votable headings from the admin section

Visual Changes

35875304-189dbd78-0b6f-11e8-84aa-a9e2d480e828

35875305-18be5998-0b6f-11e8-984e-49fb1033d42c

Notes

Now that we have the option of voting in multiple headings per group, the method of voting in a different heading assigned has become deprecated and thus removed.

Instead, knowing if a user can vote in a new heading, depends on the maximum votable headings per group variable.

Now that we have the option of voting in multiple headings per group,
the method of voting in a “different heading assigned” has become
deprecated and thus removed
There was some inconsistency in this file, the `confirm_group` key was
in both the custom translations file and the default translations file.

Remove duplication and make it a default as it is a clearer message for
users. If an installation want to edit this message they can still do
it in the custom translations file
Temporarily… because there are 2 kinds of Ruby developers, those who
indent methods under `private` and does who don’t

https://gist.github.com/joefiorini/1049083#gistcomment-37692
This method was used only in Madrid’s fork, but it is now needed to
complete the backport for voting in multiple headings

There wasn’t a test in Madrid, so here goes one too. Even though, the
responsibility should probably be moved soon to the `Budget::Heading`.
For consistency with the related methods and tests it has been left in
the investment_spec
The user was able to vote as many investments as wanted in the first
heading voted. However in the second heading voted, only one investment
could be voted

This was due to the previous implementation, where you could only vote
in one heading. Note the `first` call in method
`heading_voted_by_user?(user)`

This commits simplifies the logic and allows voting for any investment
in any heading that the user has previously voted in
@voodoorai2000 voodoorai2000 changed the title [WIP] Vote in multiple headings Vote in multiple headings Mar 22, 2018
@voodoorai2000 voodoorai2000 changed the title Vote in multiple headings Allow supporting investments on more than one heading per group Mar 22, 2018
@voodoorai2000 voodoorai2000 merged commit c4ad9b9 into master Mar 22, 2018
@voodoorai2000 voodoorai2000 deleted the vote_in_multiple_headings branch March 22, 2018 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants