lib/attach_it/attach_it.rb in mm-attach-it-0.2.1 vs lib/attach_it/attach_it.rb in mm-attach-it-0.2.2

- old
+ new

@@ -70,11 +70,13 @@ @attachment_options ||= {} @attachment_options[name] ||= AttachmentOptions.new(self, name, options) end def save_attachments - @attachment_options.keys.each do |name| - @attachment_options[name].save + unless @attachment_options.nil? + @attachment_options.keys.each do |name| + @attachment_options[name].save + end end end def destroy_attachments unless @attachment_options.nil?