Permalink
Browse files

Explicitly omitting design documents seems to propagate deletions pro…

…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...
1 parent e5a51d5 commit 4b926646d86ea23d725b7c3dd55ed3a06be47a3b Christian Kellermann committed Nov 2, 2010
Showing with 13 additions and 17 deletions.
  1. +2 −3 filters/copy_data.js
  2. +11 −14 validate_doc_update.js
View
@@ -1,7 +1,6 @@
function(doc, req) {
- if (doc.type && (( doc.type == "einnahme") || (doc.type == "ausgabe") || (doc.type == "config"))){
- return true;
- } else {
+ if ( doc._id.match('_design/(.*)') || ( doc.type && doc.type == "config")){
return false;
}
+ return true;
}
View
@@ -27,18 +27,15 @@ function(newDoc, oldDoc, userCtx){
if (! property) {throw({ forbidden : message}); }
}
- if (newDoc._deleted) return;
-
- require("type");
- if (newDoc.type == 'ausgabe'){
- require("date");
- require("betrag");
- require("kommentar");
- require("kategorie");
- } else if (newDoc.type == 'einnahme'){
- require("date");
- require("kommentar");
- require("betrag");
- require("kommentar");
- }
+ if (newDoc.type && newDoc.type == 'ausgabe'){
+ require("date");
+ require("betrag");
+ require("kommentar");
+ require("kategorie");
+ } else if (newDoc.type && newDoc.type == 'einnahme'){
+ require("date");
+ require("kommentar");
+ require("betrag");
+ require("kommentar");
+ }
}

0 comments on commit 4b92664

Please sign in to comment.