From 88ba056043e22c4c60dde6b07df897e502f49491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 25 Dec 2009 21:46:01 +0100 Subject: Refactor multiple parts logic and move Utils to PartContainer. --- actionmailer/lib/action_mailer/base.rb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'actionmailer/lib/action_mailer/base.rb') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 478762f94f..84f5bd23a9 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -253,7 +253,7 @@ module ActionMailer #:nodoc: # and appear last in the mime encoded message. You can also pick a different order from inside a method with # +implicit_parts_order+. class Base < AbstractController::Base - include PartContainer, Quoting, Utils + include PartContainer, Quoting extend AdvAttrAccessor include AbstractController::Rendering @@ -454,7 +454,7 @@ module ActionMailer #:nodoc: :default => method_name.humanize) # Build the mail object itself - @mail = create_mail + create_mail end # Delivers a TMail::Mail object. By default, it delivers the cached mail @@ -582,15 +582,7 @@ module ActionMailer #:nodoc: m.set_content_type(real_content_type, nil, ctype_attrs) m.body = normalize_new_lines(@parts.first.body) else - @parts.each do |p| - part = (TMail::Mail === p ? p : p.to_mail(self)) - m.parts << part - end - - if real_content_type =~ /multipart/ - ctype_attrs.delete "charset" - m.set_content_type(real_content_type, nil, ctype_attrs) - end + setup_multiple_parts(m, real_content_type, ctype_attrs) end @mail = m -- cgit v1.2.3