Commit graph

5 commits

Author SHA1 Message Date
Pierre de La Morinerie
872f6b0153 lib: add migration helpers for making a column unique 2021-04-13 18:09:59 +02:00
clemkeirua
03864f60cf added a custom rubocop linter in order to avoid hardcoding application name 2020-07-23 16:17:15 +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