diff options
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/vendor/tmail/attachments.rb | 2 | ||||
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb b/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb index abadd20a8a..4d8d106ad8 100644 --- a/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb @@ -7,7 +7,7 @@ module TMail class Mail def has_attachments? - multipart? && parts.any? { |part| part.header["content-type"].main_type != "text" } + multipart? && parts.any? { |part| attachment?(part) } end def attachment?(part) diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 838c49b7c3..519ca85290 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -590,6 +590,7 @@ EOF def test_attachment_with_text_type fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email13") mail = TMail::Mail.parse(fixture) + assert mail.has_attachments? assert_equal 1, mail.attachments.length assert_equal "hello.rb", mail.attachments.first.original_filename end |