def put_attachment(name, file, options={})
      raise ArgumentError, "doc must be saved" unless self.rev
      raise ArgumentError, "doc.database required to put_attachment" unless database
      result = database.put_attachment(self, name, file, options)
      self['_rev'] = result['rev']
      result['ok']
    end
def put_attachment(name, file, options={})
      raise ArgumentError, "doc must be saved" unless self.rev
      raise ArgumentError, "doc.database required to put_attachment" unless database
      result = database.put_attachment(self, name, file, options)
      self['_rev'] = result['rev']
      result['ok']
    end
saves an attachment directly to couchdb