mailcatcher 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/mail_catcher/mail.rb +4 -2
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -42,9 +42,11 @@ module MailCatcher::Mail
42
42
  mail = Mail.new(message[:source])
43
43
  result = @@add_message_query.execute(message[:sender], message[:recipients].inspect, mail.subject, message[:source], message[:source].length)
44
44
  message_id = db.last_insert_row_id
45
- (mail.all_parts || [mail]).each do |part|
45
+ (mail.all_parts.presence || [mail]).each do |part|
46
46
  body = part.body.to_s
47
- add_message_part(message_id, part.cid, part.mime_type || 'text/plain', part.attachment? ? 1 : 0, part.filename, part.charset, body, body.length)
47
+ # Only parts have CIDs, not mail
48
+ cid = part.cid if part.respond_to? :cid
49
+ add_message_part(message_id, cid, part.mime_type || 'text/plain', part.attachment? ? 1 : 0, part.filename, part.charset, body, body.length)
48
50
  end
49
51
 
50
52
  EventMachine.next_tick do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Samuel Cochran