demarches-normaliennes/app/models/concerns
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
..
.keep First Commit 2015-08-10 11:05:06 +02:00
attachment_titre_identite_watermark_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
attachment_virus_scanner_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
blob_signed_id_concern.rb Rails app:update 2020-07-07 18:03:56 +02:00
blob_titre_identite_watermark_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
blob_virus_scanner_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
dossier_filtering_concern.rb [#3477] Filter by 'column ilike values' as a scope 2019-03-11 17:14:17 +01:00
email_sanitizable_concern.rb [Fix #1479] Create a sanitize email concern 2018-03-14 17:41:45 +01:00
mail_template_concern.rb migrate emails text editor to new interface 2020-09-03 14:42:22 +02:00
procedure_stats_concern.rb Move the cached procedure stats queries to a ProcedureStatsConcern 2019-09-17 16:43:48 +02:00
tags_substitution_concern.rb tag 'groupe instructeur' uniquement si la procedure est routee 2020-02-20 14:48:14 +00:00
trusted_device_concern.rb Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00