File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,9 @@ def type
58
58
return :image if image?
59
59
return :audio if audio?
60
60
return :pdf if pdf?
61
+ return :text if text?
61
62
62
- :text
63
+ :unknown
63
64
end
64
65
65
66
def image?
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def format_content(content)
22
22
when :text
23
23
parts << format_text_file ( attachment )
24
24
else
25
- raise UnsupportedAttachmentError , attachment . type
25
+ raise UnsupportedAttachmentError , attachment . mime_type
26
26
end
27
27
end
28
28
Original file line number Diff line number Diff line change @@ -14,12 +14,14 @@ def format_content(content)
14
14
parts << format_text ( content . text ) if content . text
15
15
16
16
content . attachments . each do |attachment |
17
- parts << case attachment . type
18
- when :text
19
- format_text_file ( attachment )
20
- else
21
- format_attachment ( attachment )
22
- end
17
+ case attachment . type
18
+ when :text
19
+ parts << format_text_file ( attachment )
20
+ when :unknown
21
+ raise UnsupportedAttachmentError , attachment . mime_type
22
+ else
23
+ parts << format_attachment ( attachment )
24
+ end
23
25
end
24
26
25
27
parts
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def format_content(content)
26
26
when :text
27
27
parts << format_text_file ( attachment )
28
28
else
29
- raise UnsupportedAttachmentError , attachment . type
29
+ raise UnsupportedAttachmentError , attachment . mime_type
30
30
end
31
31
end
32
32
You can’t perform that action at this time.
0 commit comments