created upgrade helper

This commit is contained in:
Chris Anderson 2009-03-14 18:42:34 -07:00
parent 7b03c7ba25
commit 8964a9b282
3 changed files with 77 additions and 2 deletions

View file

@ -77,9 +77,11 @@ module CouchRest
end
# GET a document from CouchDB, by id. Returns a Ruby Hash.
def get(id)
def get(id, params = {})
slug = escape_docid(id)
hash = CouchRest.get("#{@uri}/#{slug}")
url = CouchRest.paramify_url("#{@uri}/#{slug}", params)
puts url
hash = CouchRest.get(url)
doc = if /^_design/ =~ hash["_id"]
Design.new(hash)
else