From e6b33a83376462619832fc51fb18929d4fc131db Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Nov 2008 11:05:44 +0100 Subject: =?UTF-8?q?Added=20lambda=20merging=20to=20OptionMerger=20(especia?= =?UTF-8?q?lly=20useful=20with=20named=5Fscope=20and=20with=5Foptions)=20[?= =?UTF-8?q?#740=20state:commited]=20(Pawe=C5=82=20Kondzior)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actionmailer/lib/action_mailer/part_container.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionmailer/lib/action_mailer/part_container.rb') diff --git a/actionmailer/lib/action_mailer/part_container.rb b/actionmailer/lib/action_mailer/part_container.rb index 3e3d6b9d4f..abfd8f8426 100644 --- a/actionmailer/lib/action_mailer/part_container.rb +++ b/actionmailer/lib/action_mailer/part_container.rb @@ -41,7 +41,11 @@ module ActionMailer private def parse_content_type(defaults=nil) - return [defaults && defaults.content_type, {}] if content_type.blank? + if content_type.blank? + return defaults ? + [ defaults.content_type, { 'charset' => defaults.charset } ] : + [ nil, {} ] + end ctype, *attrs = content_type.split(/;\s*/) attrs = attrs.inject({}) { |h,s| k,v = s.split(/=/, 2); h[k] = v; h } [ctype, {"charset" => charset || defaults && defaults.charset}.merge(attrs)] -- cgit v1.2.3