differentiated attachment's URI and URL

This commit is contained in:
Matt Aimonetti 2009-06-07 18:51:31 -07:00
parent f1b2315524
commit c18567f8fc
7 changed files with 52 additions and 23 deletions

View file

@ -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)