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

@ -68,7 +68,7 @@ module CouchRest
# Returns the CouchDB uri for the document
def uri(append_rev = false)
return nil if new_document?
couch_uri = "http://#{database.uri}/#{CGI.escape(id)}"
couch_uri = "http://#{database.root}/#{CGI.escape(id)}"
if append_rev == true
couch_uri << "?rev=#{rev}"
elsif append_rev.kind_of?(Integer)