Skip to content

Commit

Permalink
Show and list now directly call _show and _list when using the HTTP a…
Browse files Browse the repository at this point in the history
…dapter. Validation doesn't occur offline if the server handles it. No test suite regressions, but both are still experimental. (And JS coverage is lower.)
  • Loading branch information
marten-de-vries committed May 27, 2014
1 parent 19742fa commit 4c0fd6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

"use strict";

//TODO: call http equivalent if http adapter

var coucheval = require("couchdb-eval");
var couchdb_objects = require("couchdb-objects");
var nodify = require("promise-nodify");
Expand Down Expand Up @@ -68,6 +66,12 @@ function doValidation(db, newDoc, options, callback) {
resolve();
}

var isHttp = ["http", "https"].indexOf(db.type()) !== -1;
if (isHttp && !options.checkHttp) {
//CouchDB does the checking for itself. Validate succesful.
resolve();
return;
}
if ((newDoc._id || "").indexOf("_design/") === 0) {
//a design document -> always validates succesful.
resolve();
Expand Down

0 comments on commit 4c0fd6f

Please sign in to comment.