Merge pull request #5936 from betagouv/fix-zeitwerk-smtp-warning

Correction de messages d'avertissement liés à Zeitwerk (#5936)
This commit is contained in:
Pierre de La Morinerie 2021-02-25 11:44:52 +01:00 committed by GitHub
commit 8b5a012e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 16 deletions

View file

@ -1,3 +1,9 @@
# Note: this class is instanciated when being added as an interceptor
# during the app initialization.
#
# If you edit this file in development env, you will need to restart
# the app to see the changes.
class DynamicSmtpSettingsInterceptor
def self.delivering_email(message)
if ENV['SENDINBLUE_BALANCING'] == 'enabled'

View file

@ -11,22 +11,24 @@
# - but let's keep these for a while to make external integrators's life easier.
# To keep some margin, let's say this file can be safely deleted in May 2021.)
require 'excon'
Rails.application.reloader.to_prepare do
module ApiEntreprise
Job = APIEntreprise::Job
AssociationJob = APIEntreprise::AssociationJob
AttestationFiscaleJob = APIEntreprise::AttestationFiscaleJob
AttestationSocialeJob = APIEntreprise::AttestationSocialeJob
BilansBdfJob = APIEntreprise::BilansBdfJob
EffectifsAnnuelsJob = APIEntreprise::EffectifsAnnuelsJob
EffectifsJob = APIEntreprise::EffectifsJob
EntrepriseJob = APIEntreprise::EntrepriseJob
ExercicesJob = APIEntreprise::ExercicesJob
end
if !defined?(ApiEntreprise)
require 'excon'
module Cron
FixMissingAntivirusAnalysis = FixMissingAntivirusAnalysisJob
module ApiEntreprise
Job = APIEntreprise::Job
AssociationJob = APIEntreprise::AssociationJob
AttestationFiscaleJob = APIEntreprise::AttestationFiscaleJob
AttestationSocialeJob = APIEntreprise::AttestationSocialeJob
BilansBdfJob = APIEntreprise::BilansBdfJob
EffectifsAnnuelsJob = APIEntreprise::EffectifsAnnuelsJob
EffectifsJob = APIEntreprise::EffectifsJob
EntrepriseJob = APIEntreprise::EntrepriseJob
ExercicesJob = APIEntreprise::ExercicesJob
end
module Cron
FixMissingAntivirusAnalysis = FixMissingAntivirusAnalysisJob
end
end
end

View file

@ -1 +1,3 @@
ActionMailer::Base.register_interceptor "DynamicSmtpSettingsInterceptor"
ActiveSupport.on_load(:action_mailer) do
ActionMailer::Base.register_interceptor "DynamicSmtpSettingsInterceptor"
end