demarches-normaliennes/config
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
..
environments test: don't cache classes during tests 2021-02-16 15:59:35 +01:00
initializers active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
locales disable france connect authentication for admin and instructeurs 2021-02-10 18:13:47 +01:00
webpack Another attempt at fixing IE 2021-03-09 11:29:20 +01:00
application.rb config: avoid blocking legitimate requests from mobile ISPs 2021-03-11 18:28:10 +01:00
boot.rb Bump development gems 2018-03-06 16:17:22 +01:00
brakeman.ignore update brakeman 2020-12-17 10:51:09 +01:00
cable.yml Stop using staging environement 2018-08-29 11:22:56 +02:00
database.yml config: fix spring randomly crashing in the pg gem 2020-05-25 09:23:41 +00:00
deploy.rb fix deploy i_am_a_worker_test 2020-12-11 09:50:17 +01:00
env.example Add api education adapter and job 2021-01-14 17:57:48 +01:00
env.example.optional allow email footer logo to be configured in .env file 2021-02-09 09:39:02 +01:00
environment.rb Rails app:update 2020-07-07 18:03:56 +02:00
i18n-tasks.yml unused locales clean-up 2021-02-04 12:15:13 +01:00
puma.rb Puma: change config to enable cluster mode in production 2019-03-18 11:40:13 +01:00
routes.rb make and expert notifiable (controller and routes) 2021-02-16 09:46:18 +00:00
secrets.yml Add api education adapter and job 2021-01-14 17:57:48 +01:00
skylight.yml [ENV] Add skylight conf 2018-08-23 15:55:31 +02:00
spring.rb Rails app:update 2020-07-07 18:03:56 +02:00
storage.yml fix catalog v3 2020-06-19 14:20:32 +02:00
webpacker.yml Use jsx extension 2021-02-16 18:14:10 +01:00