Commit Graph

17 Commits

Author SHA1 Message Date
Javi Martín
28aafbd4bc Add and apply Style/InvertibleUnlessCondition rule
This rule was added in rubocop 1.44.0. It's useful to avoid accidental
`unless !condition` clauses.

Note we aren't replacing `unless zero?` with `if nonzero?` because we
never use `nonzero?`; using it sounds like `if !zero?`.

Replacing `unless any?` with `if none?` is only consistent if we also replace
`unless present?` with `if blank?`, so we're also adding this case. For
consistency, we're also replacing `unless blank?` with `if present?`.

We're also simplifying code dealing with `> 0` conditions in order to
make the code (hopefully) easier to understand.

Also for consistency, we're enabling the `Style/InverseMethods` rule,
which follows a similar idea.
2023-09-07 19:14:03 +02:00
Javi Martín
ea2aeab383 Apply rubocop Rails/FindBy rule everywhere
We didn't detect these cases because by default the rule only searches
for offenses in `app/models/`.
2019-11-08 19:15:04 +01:00
Javi Martín
d0d681a44b Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when
a method starts with a `return` statement.

In other cases, we probably shouldn't have a guard rule in the middle of
a method in any case, but that's a different refactoring.
2019-10-24 17:56:03 +02:00
Javi Martín
9fe8c47528 Apply Rails/SafeNavigation rubocop rule 2019-09-10 21:43:39 +02:00
German Galia
85722eb7c4 Rename admin/debates and admin/comments to hidden 2019-06-02 19:12:26 +02:00
Bertocq
dbe404d9ad Fix Officer final recount access without voting shift 2019-05-21 13:26:44 +02:00
María Checa
ccf8d3a8e2 Adds ballot sheets controller and main views 2019-04-10 16:03:47 +02:00
Javi Martín
f7f9fc15a5 Move todays_booths_for_officer to the model
This way we can easily add a test which will fail if by accident we
change the method to use `Date.today`. Until now using `Date.today`
would only fail if we ran specs in a time zone with a different date.
2019-03-28 15:49:17 +01:00
Bertocq
80a9ba8aa7 Enable and fix booth selection back 2019-03-28 15:47:52 +01:00
rgarcia
4761ac91bd Displays officing booth in layout 2019-03-28 15:47:52 +01:00
rgarcia
74706027cb fixes specs 2019-03-28 15:47:52 +01:00
rgarcia
b4499321d3 stores officer booth on sign in 2019-03-28 15:47:52 +01:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01:00
decabeza
573961a321 avoids admin access to officing panel 2017-10-21 17:37:14 +02:00
rgarcia
6c34599e1e adds officer residence check and user voting 2017-01-29 00:36:20 +01:00
Juanjo Bazán
ca0e6d6694 adds authorization for poll officers 2016-12-28 20:54:02 +01:00
rgarcia
503338e47b adds view placeholders for officing polls 2016-11-14 13:51:09 +01:00