aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-08-11 17:54:04 -0400
committerGitHub <noreply@github.com>2017-08-11 17:54:04 -0400
commitb9e0b4f19940fdd7105db3dffc507cbd89ac3705 (patch)
tree3f24b1728f9bf86c029a7897c91e1fa36d43204d /actionmailer
parentc8bbeb31dd402bb4a907a9b8ef021bf8e1afe2aa (diff)
parent0668c22a41e4c88ccb7600fc5b4bfb1a5b76e45d (diff)
downloadrails-b9e0b4f19940fdd7105db3dffc507cbd89ac3705.tar.gz
rails-b9e0b4f19940fdd7105db3dffc507cbd89ac3705.tar.bz2
rails-b9e0b4f19940fdd7105db3dffc507cbd89ac3705.zip
Merge pull request #29559 from kirs/eager-load-controller-actions
Eager load controller actions to reduce response time of the first request
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer/railtie.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb
index 36c2e5866d..69578471b0 100644
--- a/actionmailer/lib/action_mailer/railtie.rb
+++ b/actionmailer/lib/action_mailer/railtie.rb
@@ -58,6 +58,12 @@ module ActionMailer
end
end
+ initializer "action_mailer.eager_load_actions" do
+ ActiveSupport.on_load(:after_initialize) do
+ ActionMailer::Base.descendants.each(&:action_methods) if config.eager_load
+ end
+ end
+
config.after_initialize do |app|
options = app.config.action_mailer