demarches-normaliennes/app/models
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
..
champs fix constant 2021-02-19 11:29:08 +01:00
concerns active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
mails models: require belong_to associations on mail templates 2020-08-18 15:57:37 +02:00
types_de_champ Add annuaire_education champ 2021-01-14 17:57:48 +01:00
.keep First Commit 2015-08-10 11:05:06 +02:00
administrateur.rb remove dead code in admin model 2020-09-18 11:16:34 +02:00
administrateurs_procedure.rb models: generate annotations 2020-08-12 11:45:53 +02:00
api_entreprise_token.rb zeitwerk: Api -> API 2021-02-09 13:07:30 +01:00
application_record.rb Add id argument to most collections on dossier 2021-03-02 12:42:22 +01:00
assign_to.rb Update Raven references to use Sentry 2021-01-28 19:46:36 +01:00
attestation.rb models: require belong_to associations on attestation 2020-08-18 15:57:36 +02:00
attestation_template.rb models: require belong_to associations on attestation_template 2020-08-18 15:57:36 +02:00
avis.rb Revert "Revert "Claimant type to avis table"" 2021-03-10 08:48:55 +01:00
bill_signature.rb factorize read_attachment 2020-12-14 14:09:15 +01:00
champ.rb Try to reduce the number of external data fetches 2021-03-11 14:56:37 +01:00
commentaire.rb Add content validation for avis and messages 2021-01-18 17:23:08 +01:00
current.rb Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
current_confirmation.rb mailers: add procedure context to the confirmation link 2020-02-25 11:45:36 +00:00
deleted_dossier.rb EQT instructeur, je peux supprimer un dossier terminé 2020-12-16 15:00:26 +01:00
demande.rb [fix #1601] show pipedrive demandes in manager 2018-03-22 15:37:16 +01:00
dossier.rb Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
dossier_operation_log.rb Add SerializerService 2021-03-02 12:42:22 +01:00
entreprise.rb Make some api entreprise fields optional 2021-01-27 11:53:00 +01:00
etablissement.rb Ignore entreprise_id on etablissements 2021-01-27 11:53:00 +01:00
exercice.rb models: require belong_to associations on exercice 2020-08-18 15:57:36 +02:00
expert.rb add an email method to expert model 2021-01-26 13:59:09 +01:00
experts_procedure.rb change active record request to get expert list 2021-02-16 09:46:18 +00:00
export.rb compute async only after create 2020-09-29 14:00:31 +02:00
feedback.rb models: require belong_to associations on feedback 2020-08-18 15:57:36 +02:00
follow.rb models: require belong_to associations on follow 2020-08-18 15:57:37 +02:00
france_connect_information.rb ignore when FranceConnect calls callback 2 times 2021-02-10 18:13:47 +01:00
france_connect_particulier_client.rb FC initializers: remove Hashie 2018-01-15 17:08:38 +01:00
geo_area.rb Add geo json validation 2021-03-11 15:51:09 +01:00
groupe_instructeur.rb Rename for consistency with defaut_groupe_instructeur 2021-03-04 10:45:02 +01:00
individual.rb affiche Madame ou Monsieur 2020-12-08 21:30:54 +01:00
instructeur.rb refactor Dossier#with_notifications 2020-09-21 08:28:42 +00:00
invite.rb use after_create instead of after_save 2020-09-29 18:15:38 +00:00
module_api_carto.rb models: require belong_to associations on module_api_carto 2020-08-18 15:57:37 +02:00
procedure.rb Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
procedure_overview.rb removed routing condition in weekly summary 2020-01-20 14:23:19 +01:00
procedure_presentation.rb Add migration task to use stable_id in filters 2020-12-17 10:51:09 +01:00
procedure_revision.rb Include in exports types_de_champ from all revisions 2020-09-30 13:42:38 +02:00
procedure_revision_type_de_champ.rb Remove migration service 2020-09-02 11:26:26 +02:00
service.rb models: require belong_to associations on service 2020-08-18 15:57:37 +02:00
siret.rb Do one thing per line 2018-10-01 16:15:46 +02:00
stat.rb cache landing data 2020-10-06 16:12:01 +02:00
super_admin.rb extract password complexity validator 2020-12-15 16:26:09 +01:00
traitement.rb models: require belong_to associations on traitement 2020-08-18 15:57:37 +02:00
trusted_device_token.rb models: require belong_to associations on trusted_device_token 2020-08-18 15:57:37 +02:00
type_de_champ.rb add skip_content_type_pj_validation attr to pj 2021-01-18 15:12:17 +01:00
user.rb disable france connect authentication for admin and instructeurs 2021-02-10 18:13:47 +01:00