diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-13 19:04:56 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-13 19:04:56 -0500 |
commit | 04248c62086b188ae354ed90ae40c832b79fd19c (patch) | |
tree | 01d6094bab843a037e8e8f786499b720831208dc | |
parent | 2561be005b1180883ccf1d0f7ad38858d9348064 (diff) | |
download | rails-04248c62086b188ae354ed90ae40c832b79fd19c.tar.gz rails-04248c62086b188ae354ed90ae40c832b79fd19c.tar.bz2 rails-04248c62086b188ae354ed90ae40c832b79fd19c.zip |
Ensure templates are rendered if all the parts are already processed
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 5 | ||||
-rw-r--r-- | actionmailer/test/fixtures/test_mailer/signed_up.html.erb (renamed from actionmailer/test/fixtures/test_mailer/signed_up.erb) | 0 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 1583fb4066..72c94529b5 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -470,8 +470,9 @@ module ActionMailer #:nodoc: # also render a "normal" template (without the content type). If a # normal template exists (or if there were no implicit parts) we render # it. - template = template_root["#{mailer_name}/#{@template}"] - @body = render_message(@template, @body) if template + template_exists = @parts.empty? + template_exists ||= template_root["#{mailer_name}/#{@template}"] + @body = render_message(@template, @body) if template_exists # Finally, if there are other message parts and a textual body exists, # we shift it onto the front of the parts and set the body to nil (so diff --git a/actionmailer/test/fixtures/test_mailer/signed_up.erb b/actionmailer/test/fixtures/test_mailer/signed_up.html.erb index a85d5fa442..a85d5fa442 100644 --- a/actionmailer/test/fixtures/test_mailer/signed_up.erb +++ b/actionmailer/test/fixtures/test_mailer/signed_up.html.erb |