Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Merge upstream pull request flatiron#224 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomi Nokkala committed Feb 6, 2014
2 parents dd59aba + 246e4b9 commit a8221fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/cradle/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ this.Cache.prototype = {
that.keys -= pruned;
});
}
}
},
purgeall: function() {
this.store = [];
this.keys = 0;
};

function clone(obj) {
Expand Down
8 changes: 4 additions & 4 deletions lib/cradle/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ Database.prototype.create = function (callback) {
Database.prototype.destroy = function (callback) {
if (arguments.length > 1) {
throw new(Error)("destroy() doesn't take any additional arguments");
}

}
this.cache.purgeall();
this.query({
method: 'DELETE',
path: '/',
}, callback);
}, callback);
};

//
Expand All @@ -63,4 +63,4 @@ Database.prototype.destroy = function (callback) {
require('./attachments');
require('./changes');
require('./documents');
require('./views');
require('./views');

0 comments on commit a8221fd

Please sign in to comment.