Permalink
Browse files

mail.attachments returns an array which evaluates to true, changed to…

… a size check
  • Loading branch information...
1 parent c02ab22 commit c669c82242e86c0d4fbb8088742fed29f517ca1e @davidcornu committed May 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/letter_opener/message.rb
@@ -12,7 +12,7 @@ def initialize(location, mail, part = nil)
def render
FileUtils.mkdir_p(@location)
- if mail.attachments
+ if mail.attachments.size > 0
attachments_dir = File.join(@location,'attachments')
FileUtils.mkdir_p(attachments_dir)
mail.attachments.each do |attachment|

0 comments on commit c669c82

Please sign in to comment.