aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-11-15 11:05:44 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-15 16:44:47 +0100
commite6b33a83376462619832fc51fb18929d4fc131db (patch)
treece0576786f3ae819a61b693261250afed7f99563 /actionmailer/lib
parent44c3b865ac52a7c9a6312982ba0f6c20d7ad41e1 (diff)
downloadrails-e6b33a83376462619832fc51fb18929d4fc131db.tar.gz
rails-e6b33a83376462619832fc51fb18929d4fc131db.tar.bz2
rails-e6b33a83376462619832fc51fb18929d4fc131db.zip
Added lambda merging to OptionMerger (especially useful with named_scope and with_options) [#740 state:commited] (Paweł Kondzior)
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer/part_container.rb6
1 files changed, 5 insertions, 1 deletions
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)]