diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-04-29 19:47:21 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-04-29 19:47:21 -0300 |
commit | b0bd4f45fa9180793e3c35590c8a887ddfe43553 (patch) | |
tree | d1ab690267c5e4d9d04faca14d4695f163375086 /actionmailer | |
parent | 19d2ff83db5232a816dee201800baf3924705b31 (diff) | |
parent | db892ea77563dadb6fbbd242be78ff87321d0bd1 (diff) | |
download | rails-b0bd4f45fa9180793e3c35590c8a887ddfe43553.tar.gz rails-b0bd4f45fa9180793e3c35590c8a887ddfe43553.tar.bz2 rails-b0bd4f45fa9180793e3c35590c8a887ddfe43553.zip |
Merge commit 'rails/master'
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 11 | ||||
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 69e77871b0..af2cc2ee24 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -475,7 +475,7 @@ module ActionMailer #:nodoc: # if @parts.empty? template_root.find_all_by_parts(@template, {}, template_path).each do |template| @parts << Part.new( - :content_type => Mime::Type.lookup_by_extension(template.content_type || "text").to_s, + :content_type => template.mime_type ? template.mime_type.to_s : "text/plain", :disposition => "inline", :charset => charset, :body => render_template(template, @body) @@ -555,12 +555,13 @@ module ActionMailer #:nodoc: end def render_template(template, body) - if template.respond_to?(:content_type) - @current_template_content_type = template.content_type + if template.respond_to?(:mime_type) + @current_template_content_type = template.mime_type && template.mime_type.to_sym.to_s end @template = initialize_template_class(body) - layout = _pick_layout(layout, true) unless template.exempt_from_layout? + layout = _pick_layout(layout, true) unless + ActionController::Base.exempt_from_layout.include?(template.handler) @template._render_template_with_layout(template, layout, {}) ensure @current_template_content_type = nil @@ -584,7 +585,7 @@ module ActionMailer #:nodoc: end layout = _pick_layout(layout, - !template || !template.exempt_from_layout?) + !template || ActionController::Base.exempt_from_layout.include?(template.handler)) if template @template._render_template_with_layout(template, layout, opts) diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index b27bda49be..919ab5de94 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -994,13 +994,13 @@ end class InheritableTemplateRootTest < Test::Unit::TestCase def test_attr - expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots" + expected = File.expand_path("#{File.dirname(__FILE__)}/fixtures/path.with.dots") assert_equal expected, FunkyPathMailer.template_root.to_s sub = Class.new(FunkyPathMailer) sub.template_root = 'test/path' - assert_equal 'test/path', sub.template_root.to_s + assert_equal File.expand_path('test/path'), sub.template_root.to_s assert_equal expected, FunkyPathMailer.template_root.to_s end end |