Commit Graph

20 Commits

Author SHA1 Message Date
Javi Martín
7ca55c44e0 Apply Rails/SaveBang rubocop rule
Having exceptions is better than having silent bugs.

There are a few methods I've kept the same way they were.

The `RelatedContentScore#score_with_opposite` method is a bit peculiar:
it creates scores for both itself and the opposite related content,
which means the opposite related content will try to create the same
scores as well.

We've already got a test to check `Budget::Ballot#add_investment` when
creating a line fails ("Edge case voting a non-elegible investment").

Finally, the method `User#send_oauth_confirmation_instructions` doesn't
update the record when the email address isn't already present, leading
to the test "Try to register with the email of an already existing user,
when an unconfirmed email was provided by oauth" fo fail if we raise an
exception for an invalid user. That's because updating a user's email
doesn't update the database automatically, but instead a confirmation
email is sent.

There are also a few false positives for classes which don't have bang
methods (like the GraphQL classes) or destroying attachments.

For these reasons, I'm adding the rule with a "Refactor" severity,
meaning it's a rule we can break if necessary.
2019-10-23 14:39:31 +02:00
Javi Martín
ad14636255 Use Tag instead of ActsAsTaggableOn::Tag
It's shorter, it's easier to extend its behaviour, and it's easier to
integrate with other parts of our application, like translations.
2019-10-05 03:38:44 +02:00
Julian Herrero
b122302c58 Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
2019-06-03 17:54:19 +02:00
rgarcia
998b4d9e39 Load budgets using slugs 2019-06-03 16:54:39 +02:00
Julian Herrero
0858f4c6f4 cleanup (remove unused code) 2019-01-09 17:49:46 +01:00
Julian Herrero
2081269a67 fix Hound violations 2019-01-02 10:46:31 +01:00
Julian Herrero
6439be44f1 change CRUD for budget groups and headings
To make it more consistent with the rest of the Admin panel,
the CRUD for budget groups and headings has been changed
from the old "all-in-one" form to a separate form for each resource.
2018-12-14 16:34:54 +01:00
Eduardo Martinez Echevarria
8dd52110db Use category scope instead of condition on kind on Tag 2017-06-23 17:34:55 +02:00
Juanjo Bazán
86c37d4952 removes old commented code 2017-05-16 13:12:55 +02:00
Juanjo Bazán
3eb22ab7b9 removes exception on invalid vote
responds rendering correct error message instead
2017-05-16 13:12:32 +02:00
rgarcia
10282d67ab fixes typo 2017-05-15 11:53:01 +02:00
rgarcia
8e7ca16c47 makes ballot's back link point to referer 2017-05-05 20:07:24 +02:00
rgarcia
289666bb4d loads tag cloud in balloting phase 2017-01-15 12:08:41 +01:00
rgarcia
938ba40306 loads categories in sidebar for balloting phase 2017-01-15 12:06:38 +01:00
kikito
260b9aa1e4 loads @investment_ids in ballot lines controller 2016-12-22 20:25:41 +01:00
kikito
a73626d712 Refactors and simplifies ballot/lines_controller.rb 2016-12-19 19:11:45 +01:00
kikito
869f7b39d6 fixes i18n 2016-12-08 11:49:13 +01:00
rgarcia
22373c3ddd Review my votes page 2016-09-10 16:22:41 +02:00
rgarcia
1c8f4d5ff0 can remove investment projects 2016-09-10 16:22:41 +02:00
rgarcia
9839d7afd0 can add investments to ballot 2016-09-10 16:22:40 +02:00