From ee74df9e681f935e2fbcc30be015bdd0d1707dac Mon Sep 17 00:00:00 2001 From: Joshua Krall Date: Sun, 19 Apr 2009 05:13:24 -0500 Subject: [PATCH] Fixed bug in format spec for actionmailer layouts. It caused problem with autodetection of multipart layouts, because it used Mime::Type.lookup and returned :text instead of the more specific 'text.plain' --- actionmailer/lib/action_mailer/base.rb | 2 +- .../fixtures/layouts/auto_layout_mailer.html.erb | 1 - .../fixtures/layouts/auto_layout_mailer.text.erb | 1 - .../layouts/auto_layout_mailer.text.html.erb | 1 + .../layouts/auto_layout_mailer.text.plain.erb | 1 + 5 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb delete mode 100644 actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb create mode 100644 actionmailer/test/fixtures/layouts/auto_layout_mailer.text.html.erb create mode 100644 actionmailer/test/fixtures/layouts/auto_layout_mailer.text.plain.erb diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index b77409b..c805a4e 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -571,7 +571,7 @@ module ActionMailer #:nodoc: def default_template_format if @current_template_content_type - Mime::Type.lookup(@current_template_content_type).to_sym + @current_template_content_type.sub('/','.') else :html end diff --git a/actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb b/actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb deleted file mode 100644 index 9322714..0000000 --- a/actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb +++ /dev/null @@ -1 +0,0 @@ -Hello from layout <%= yield %> \ No newline at end of file diff --git a/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb b/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb deleted file mode 100644 index 111576b..0000000 --- a/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb +++ /dev/null @@ -1 +0,0 @@ -text/plain layout - <%= yield %> \ No newline at end of file diff --git a/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.html.erb b/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.html.erb new file mode 100644 index 0000000..9322714 --- /dev/null +++ b/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.html.erb @@ -0,0 +1 @@ +Hello from layout <%= yield %> \ No newline at end of file diff --git a/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.plain.erb b/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.plain.erb new file mode 100644 index 0000000..111576b --- /dev/null +++ b/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.plain.erb @@ -0,0 +1 @@ +text/plain layout - <%= yield %> \ No newline at end of file -- 1.5.3.7