Commit Graph

14 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
031b5aba63 Remove unnecessary html_safe in paths
Paths are just regular strings with no HTML, so they don't need to be
marked as safe HTML.
2019-10-08 13:20:22 +02:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01:00
Javi Martín
f1ccdb87b1 Fix removing an option for legislation questions
We were allowing the `_destroy` field for translations, but not for the
options themselves.
2018-10-22 16:36:17 +02:00
Javi Martín
6952c9c9db Fix legislation options not being updated
We broke this behaviour by introducing translations and not allowing the
`id` parameter anymore.
2018-10-22 16:36:17 +02:00
Javi Martín
85701bd754 Update legislation questions translatable fields 2018-10-22 15:46:24 +02:00
Marko Lovic
06347062dd Make Legislation Questions translatable 2018-09-19 14:54:24 +02:00
Bertocq
118deb9fc4 Fix line lenght offenses at multiple controllers 2018-02-19 11:09:19 +01:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Fernando Blat
1fbb10ff34 Include link to resource in the flash message 2017-01-05 17:03:08 +01:00
Fernando Blat
ed714f7c7d Add flash messages. Redirect to edit action after update 2017-01-05 12:56:55 +01:00
Amaia Castro
30ec5bdcb5 Build one option for the questions form when creating a new question 2016-12-30 11:22:39 +01:00
Amaia Castro
55eb03531c Comments in legislation question page 2016-12-23 09:35:02 +01:00
Amaia Castro
d25d6c178c Legislation Questions model and basic admin 2016-12-20 18:52:43 +01:00