提交 ef602f88 编写于 作者: G George Claghorn

Fix preparing the configured Action Mailbox ingress in production

When reloading is disabled, after_initialize hooks run after to_prepare hooks have already run for the last time. Since to_prepare hooks always run after application initializers, we don't need need to use an after_initialize hook.
上级 4ea06701
......@@ -29,10 +29,9 @@ class Engine < Rails::Engine
end
end
initializer "action_mailbox.ingress" do
config.after_initialize do |app|
if ActionMailbox.ingress = app.config.action_mailbox.ingress.presence
initializer "action_mailbox.ingress" do |app|
config.to_prepare do
if ActionMailbox.ingress = app.config.action_mailbox.ingress.presence
if ingress_controller_class = "ActionMailbox::Ingresses::#{ActionMailbox.ingress.to_s.classify}::InboundEmailsController".safe_constantize
ingress_controller_class.prepare
end
......@@ -40,5 +39,4 @@ class Engine < Rails::Engine
end
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册