Commit graph

4 commits

Author SHA1 Message Date
Colin Darie
77fb0553fc
chore: enable freeze string literals by comment 2024-08-22 09:26:48 +02:00
Pierre de La Morinerie
cbaa584bd0 lint: improve Rubocop detection
Instead on relying on the environment, we try to load the Rubocop cop
only if Rubocop is currently loaded.
2020-02-03 11:09:11 +01:00
clemkeirua
eb20dd9153 only load unscoped custom rule in development 2020-01-30 15:23:21 +01:00
Pierre de La Morinerie
cf101d64d8 lint: add a Rubocop rule to forbid the use of unscoped
`unscoped` often has an effect broader than intended. For instance:

```
user.dossiers.unscoped.destroy_all
```

will not destroy all the user's dossier, including the hidden ones,
but **all the dossiers of all users**.

Instead, narrower unscoping should be used:

```
user.dossiers.unscope(where: :hidden).destroy_all
```

(Or even better, use the new `Dossier.with_hidden` scope).
2020-01-28 17:32:38 +01:00