提交 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,13 +29,11 @@ class Engine < Rails::Engine ...@@ -29,13 +29,11 @@ class Engine < Rails::Engine
end end
end end
initializer "action_mailbox.ingress" do initializer "action_mailbox.ingress" do |app|
config.after_initialize do |app| config.to_prepare do
if ActionMailbox.ingress = app.config.action_mailbox.ingress.presence if ActionMailbox.ingress = app.config.action_mailbox.ingress.presence
config.to_prepare do if ingress_controller_class = "ActionMailbox::Ingresses::#{ActionMailbox.ingress.to_s.classify}::InboundEmailsController".safe_constantize
if ingress_controller_class = "ActionMailbox::Ingresses::#{ActionMailbox.ingress.to_s.classify}::InboundEmailsController".safe_constantize ingress_controller_class.prepare
ingress_controller_class.prepare
end
end end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册