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

Override Proposal#update_votes_count to fetch the api count #90

Closed
davefrey opened this issue Apr 5, 2021 · 1 comment
Closed

Override Proposal#update_votes_count to fetch the api count #90

davefrey opened this issue Apr 5, 2021 · 1 comment

Comments

@davefrey
Copy link
Member

davefrey commented Apr 5, 2021

We've been wondering what to do with this "abandoned" method that refreshes the vote count with the votes found in the association, like this: update_columns(proposal_votes_count: votes.count).

Rather than just log and try to change code to handle other Decidim calls of Proposal#update_votes_count, we should simply retrieve the vote count from the LV api and update the attribute with that. And keep logging the occurrences.

This was we don't need to worry about the calls, they will always result in the count from the system of record being used.

@oliverbarnes
Copy link
Member

As per discussion on slack, rather than defensively having api calls from the db model, we're going with compiling where the calls are made and then bypass them explicitly

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

No branches or pull requests

2 participants