differentiated attachment's URI and URL
This commit is contained in:
parent
f1b2315524
commit
c18567f8fc
7 changed files with 52 additions and 23 deletions
|
@ -44,6 +44,12 @@ module CouchRest
|
|||
"#{database.root}/#{self.id}/#{attachment_name}"
|
||||
end
|
||||
|
||||
# returns URI to fetch the attachment from
|
||||
def attachment_uri(attachment_name)
|
||||
return unless has_attachment?(attachment_name)
|
||||
"#{database.uri}/#{self.id}/#{attachment_name}"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def encode_attachment(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue