Skip to content

Commit

Permalink
Explicitly omitting design documents seems to propagate deletions pro…
Browse files Browse the repository at this point in the history
…perly

Also omit replication of config document. Allow all other documents to
be changed, even if they have a totally different structure than
einnahmen and ausgaben.
  • Loading branch information
Christian Kellermann authored and Christian Kellermann committed Nov 2, 2010
1 parent e5a51d5 commit 4b92664
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
5 changes: 2 additions & 3 deletions filters/copy_data.js
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
function(doc, req) { function(doc, req) {
if (doc.type && (( doc.type == "einnahme") || (doc.type == "ausgabe") || (doc.type == "config"))){ if ( doc._id.match('_design/(.*)') || ( doc.type && doc.type == "config")){
return true;
} else {
return false; return false;
} }
return true;
} }
25 changes: 11 additions & 14 deletions validate_doc_update.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ function(newDoc, oldDoc, userCtx){
if (! property) {throw({ forbidden : message}); } if (! property) {throw({ forbidden : message}); }
} }


if (newDoc._deleted) return; if (newDoc.type && newDoc.type == 'ausgabe'){

require("date");
require("type"); require("betrag");
if (newDoc.type == 'ausgabe'){ require("kommentar");
require("date"); require("kategorie");
require("betrag"); } else if (newDoc.type && newDoc.type == 'einnahme'){
require("kommentar"); require("date");
require("kategorie"); require("kommentar");
} else if (newDoc.type == 'einnahme'){ require("betrag");
require("date"); require("kommentar");
require("kommentar"); }
require("betrag");
require("kommentar");
}
} }

0 comments on commit 4b92664

Please sign in to comment.