Skip to content
Browse files

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

… a size check
  • Loading branch information...
1 parent 24c37d2 commit 08438b9e1755a77de8056cd156899d76330424cc @davidcornu committed May 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/letter_opener/message.rb
View
2 lib/letter_opener/message.rb
@@ -21,7 +21,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 08438b9

Please sign in to comment.
Something went wrong with that request. Please try again.