aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-19 17:20:15 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-19 17:20:20 +0100
commitf28d856cece877d1b2f306f54aeb12cce1db1023 (patch)
treef2ca547068d20558acc80433ef5f667f61f78737 /actionmailer/lib/action_mailer/base.rb
parentfbe35656a95228f760a2cd09676423ba41fe70ab (diff)
downloadrails-f28d856cece877d1b2f306f54aeb12cce1db1023.tar.gz
rails-f28d856cece877d1b2f306f54aeb12cce1db1023.tar.bz2
rails-f28d856cece877d1b2f306f54aeb12cce1db1023.zip
Improve performance of the rendering stack by freezing formats as a sign that they shouldn't be further modified.
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r--actionmailer/lib/action_mailer/base.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 0823120fc8..1dc2d92c43 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -605,6 +605,8 @@ module ActionMailer #:nodoc:
templates_name = headers.delete(:template_name) || action_name
each_template(templates_path, templates_name) do |template|
+ self.formats = template.formats
+
responses << {
:body => render(:template => template),
:content_type => template.mime_type.to_s