demarches-normaliennes/config
Pierre de La Morinerie 9ad57fde2a initializers: lazy-load Mailjet gem
This fixes an error message on app startup about autoloaded
constants:

> DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

The reason for this error is that the Mailjet gem forces the
immediate loading of `action_mailer`. Which leads to the
following sequence of events:

On app init, when bundler requires all the gems in the Gemfile:
- The Mailjet gem is required,
- It loads `ActionMailer::Base`.

Later, when Rails initializes itself:
- `ActionText` creates an `action_text.helpers` initializer,
- This initializer register hooks to add `ActionText` helpers
when either `action_controller_base` or `action_mailer` are loaded,
- But as `action_mailer` has already been loaded, the hook is trigerred
immediately,
- ActiveSupport::Dependencies notices `ActionText` constants do not
exist yet, auto-load them, and add the constants to
`ActiveSupport::Dependencies.autoloaded_constants`.

And even later, at the end of the Rails initialization process:
- The `:warn_if_autoloaded` initializer is run,
- It notices that `autoloaded_constants` is not empty, and prints the
warning message.

See https://github.com/mailjet/mailjet-gem/issues/213
2021-04-20 15:11:43 +02:00
..
environments app: update code to Rails 6.1 2021-03-25 13:24:53 +01:00
initializers initializers: lazy-load Mailjet gem 2021-04-20 15:11:43 +02:00
locales password: add password reset instructions 2021-04-20 09:34:53 +02:00
webpack Another attempt at fixing IE 2021-03-09 11:29:20 +01:00
application.rb only preload what is needed on most requests 2021-04-06 18:23:14 +02:00
boot.rb app: enable Bootsnap 2021-03-19 08:05:14 +01:00
brakeman.ignore update brakeman 2020-12-17 10:51:09 +01:00
cable.yml app: update code to Rails 6.1 2021-03-25 13:24:53 +01:00
database.yml config: fix spring randomly crashing in the pg gem 2020-05-25 09:23:41 +00:00
deploy.rb add webserver file logic 2021-03-29 18:45:40 +02:00
env.example ci: check for zeitwerk errors 2021-04-15 13:17:46 +02:00
env.example.optional use env for localization to avoid db round trip 2021-04-06 18:23:14 +02:00
environment.rb app: update code to Rails 6.1 2021-03-25 13:24:53 +01:00
i18n-tasks.yml unused locales clean-up 2021-02-04 12:15:13 +01:00
puma.rb app: update code to Rails 6.1 2021-03-25 13:24:53 +01:00
routes.rb add route 2021-04-19 10:23:45 +02: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