demarches-normaliennes/app
Pierre de La Morinerie 75a1046315 active_storage: refactor concerns
Follow-up of #5953.

Refactor the concerns with two goals:

- Getting closer from the way ActiveStorage adds its own hooks.
  Usually ActiveStorage does this using an `Attachment#after_create`
  hook, which then delegates to the blob to enqueue the job.
- Enqueuing each job only once. By hooking on `Attachment#after_create`,
  we guarantee each job will be added only once.

We then let the jobs themselves check if they are relevant or not, and
retry or discard themselves if necessary.

We also need to update the tests a bit, because Rails'
`perform_enqueued_jobs(&block)` test helper doesn't honor the `retry_on`
clause of jobs. Instead it forwards the exception to the caller – which
makes the test fail.

Instead we use the inline version of `perform_enqueued_jobs()`, without
a block, which properly ignores errors catched by retry_on.
2021-03-16 11:49:14 +01:00
..
assets gems: upgrade to Sprockets 4 2021-02-24 17:09:51 +01:00
controllers Revert "Revert "Claimant type to avis table"" 2021-03-10 08:48:55 +01:00
dashboards bump administrate 2020-09-21 11:15:25 +02:00
fields manager: remove support for old pj 2019-07-30 16:11:17 +02:00
graphql capital_social and numero_tva_intracommunautaire can be null 2021-03-11 11:13:50 +01:00
helpers Cleanup feature flags usage 2021-03-04 11:06:04 +01:00
javascript Handle invalid GeoJSON in the editor 2021-03-11 15:51:09 +01:00
jobs active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
lib Add api address external data fetch 2021-02-17 19:10:16 +01:00
mailers mailers: fix Ruby 2.7 arguments passing 2021-02-09 09:20:46 +01:00
models active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
policies policies: clarify the role of ChampPolicy 2020-06-24 15:42:30 +02:00
schemas Add api address external data fetch 2021-02-17 19:10:16 +01:00
serializers Add SerializerService 2021-03-02 12:42:22 +01:00
services Use revision instead of groupe instructeur as dossier procedure link 2021-03-09 14:47:23 +01:00
validators Add geo json validation 2021-03-11 15:51:09 +01:00
views Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00