diff options
author | wycats <wycats@gmail.com> | 2010-03-26 15:10:24 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-03-26 15:10:24 -0700 |
commit | 197904341f2b2f21d69c653cede3aec124e86720 (patch) | |
tree | 83f1234e238016126860a929594db22e1862d783 /actionmailer/lib/action_mailer/base.rb | |
parent | 76d2c455c0607b4cd5f238cadef8f933a18567fb (diff) | |
parent | b3a0aed028835ce4551c4a76742744a40a71b0be (diff) | |
download | rails-197904341f2b2f21d69c653cede3aec124e86720.tar.gz rails-197904341f2b2f21d69c653cede3aec124e86720.tar.bz2 rails-197904341f2b2f21d69c653cede3aec124e86720.zip |
Merge branch 'master' into docrails
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index f94e23fe05..1dc2d92c43 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -1,6 +1,7 @@ require 'mail' require 'action_mailer/tmail_compat' require 'action_mailer/collector' +require 'active_support/core_ext/array/wrap' module ActionMailer #:nodoc: # Action Mailer allows you to send email from your application using a mailer model and views. @@ -604,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 @@ -615,7 +618,7 @@ module ActionMailer #:nodoc: end def each_template(paths, name, &block) #:nodoc: - Array(paths).each do |path| + Array.wrap(paths).each do |path| templates = lookup_context.find_all(name, path) templates = templates.uniq_by { |t| t.formats } |