fixed mime types for latest couchdb revision
This commit is contained in:
parent
4858ac0cba
commit
fa0d970d31
|
@ -13,16 +13,13 @@ class CouchRest
|
||||||
CouchRest.get "#{@root}/_all_docs"
|
CouchRest.get "#{@root}/_all_docs"
|
||||||
end
|
end
|
||||||
|
|
||||||
def temp_view map, reduce = nil
|
def temp_view map, reduce = nil, type = 'application/json'
|
||||||
if reduce
|
funcs = {
|
||||||
funcs = {
|
:map => map,
|
||||||
:map => map,
|
:type => type
|
||||||
:reduce => reduce
|
}
|
||||||
}
|
funcs[:reduce] = reduce if reduce
|
||||||
else
|
JSON.parse(RestClient.post("#{@root}/_temp_view", JSON.unparse(funcs), {"Content-Type" => type}))
|
||||||
funcs = map
|
|
||||||
end
|
|
||||||
JSON.parse(RestClient.post("#{@root}/_temp_view", JSON.unparse(funcs), {"Content-Type" => "text/javascript"}))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def view name
|
def view name
|
||||||
|
|
Loading…
Reference in a new issue