better attachment api
This commit is contained in:
parent
b350a51963
commit
881b18b0f0
|
@ -63,14 +63,10 @@ class CouchRest
|
|||
end
|
||||
private
|
||||
def encode_attachments attachments
|
||||
result = {}
|
||||
attachments.each do |k,v|
|
||||
result[k] = {
|
||||
"type" => v['type'],
|
||||
"data" => base64(v['data'])
|
||||
}
|
||||
v['data'] = base64(v['data'])
|
||||
end
|
||||
result
|
||||
attachments
|
||||
end
|
||||
def base64 data
|
||||
Base64.encode64(data).gsub(/\s/,'')
|
||||
|
|
Loading…
Reference in a new issue