Fixing incorrectly generated document URIs with testing

This commit is contained in:
Sam Lown iMac 2009-09-28 21:42:17 +02:00
parent 2f2c507582
commit bb2c7e87ad
2 changed files with 10 additions and 2 deletions

View file

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