75a1046315
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. |
||
---|---|---|
.. | ||
champs | ||
concern | ||
types_de_champ | ||
administrateur_spec.rb | ||
assign_to_spec.rb | ||
attestation_template_spec.rb | ||
avis_spec.rb | ||
bill_signature_spec.rb | ||
champ_private_spec.rb | ||
champ_shared_example.rb | ||
champ_spec.rb | ||
commentaire_spec.rb | ||
deleted_dossier_spec.rb | ||
dossier_spec.rb | ||
etablissement_spec.rb | ||
exercice_spec.rb | ||
expert_spec.rb | ||
experts_procedure_spec.rb | ||
export_spec.rb | ||
france_connect_information_spec.rb | ||
france_connect_particulier_client_spec.rb | ||
geo_area_spec.rb | ||
groupe_instructeur_spec.rb | ||
individual_spec.rb | ||
instructeur_spec.rb | ||
invite_spec.rb | ||
procedure_overview_spec.rb | ||
procedure_presentation_spec.rb | ||
procedure_revision_spec.rb | ||
procedure_spec.rb | ||
service_spec.rb | ||
siret_spec.rb | ||
super_admin_spec.rb | ||
trusted_device_token_spec.rb | ||
type_de_champ_private_spec.rb | ||
type_de_champ_shared_example.rb | ||
type_de_champ_spec.rb | ||
user_spec.rb |