Skip to content
Browse files

Fix initial condition when no attachments are present

  • Loading branch information...
1 parent abe6bc8 commit ddb3976b2edb98dcc5acbf69fe6ddd5da543fc74 @topfunky committed Aug 6, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/note.rb
View
2 app/models/note.rb
@@ -19,7 +19,7 @@ def attachment=(attachment)
:name => attachment_filename,
:content_type => attachment.content_type
}
- if self['_attachments'].has_key?(attachment_filename)
+ if self.has_key?('_attachments') && self['_attachments'].has_key?(attachment_filename)
update_attachment(attachment_options)
else
create_attachment(attachment_options)

0 comments on commit ddb3976

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