Commit 30b0e964 authored by Bryan Kaperick's avatar Bryan Kaperick

Revision history tests are passing as expected now.

parent adb69072
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// Prepare to post the current doc as a deprecated version // Prepare to post the current doc as a deprecated version
previous_data = latest_data; previous_data = latest_data;
previous_data._deprecated = true; previous_data._deprecated = "true";
previous_data._doc_id = id; previous_data._doc_id = id;
// Get most recent deprecated version's _revision attribute // Get most recent deprecated version's _revision attribute
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
}) })
.push(function (query_results) { .push(function (query_results) {
if (query_results.length > 0) { if (query_results.data.rows.length > 0) {
var doc_id = query_results[0]; var doc_id = query_results.data.rows[0].id;
return this._sub_storage.get(doc_id); return substorage.get(doc_id);
} }
throw new jIO.util.jIOError( throw new jIO.util.jIOError(
"bryanstorage: query returned no results.'", "bryanstorage: query returned no results.'",
...@@ -143,30 +143,16 @@ ...@@ -143,30 +143,16 @@
BryanStorage.prototype.hasCapacity = function () { BryanStorage.prototype.hasCapacity = function () {
return this._sub_storage.hasCapacity.apply(this._sub_storage, arguments); return this._sub_storage.hasCapacity.apply(this._sub_storage, arguments);
}; };
/**
BryanStorage.prototype.allDocs = function (options) { BryanStorage.prototype.buildQuery = function (options) {
if (options === undefined) {
options = {};
}
console.log("options", options);
if (options === undefined) { if (options === undefined) {
options = {query: ""}; options = {query: ""};
} }
options.query = '(' + options.query + ') AND NOT (_deprecated = true)'; if (options.query !== "") {
console.log("query string: ", options.query); options.query = "(" + options.query + ") AND ";
return this._sub_storage.allDocs.apply(this._sub_storage, options);
//return this._sub_storage.buildQuery.apply(this._sub_storage, options);
};
**/
BryanStorage.prototype.buildQuery = function () {
/**
if (options === undefined) {
options = {};
} }
options.query = '(' + options.query + ') AND NOT (_deprecated = true)'; options.query = options.query + 'NOT (_deprecated: "true")';
**/ return this._sub_storage.buildQuery(options);
console.log("options", arguments);
return this._sub_storage.buildQuery.apply(this._sub_storage, arguments);
}; };
jIO.addStorage('bryan', BryanStorage); jIO.addStorage('bryan', BryanStorage);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment