summaryrefslogtreecommitdiff
path: root/lib/tapicero/couch_changes.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-11-27 10:21:37 +0100
committerAzul <azul@riseup.net>2013-11-27 10:29:06 +0100
commit905307a871d6dfdce6d7120457bf653b8b6234a3 (patch)
tree65624a2237441a0cde1b7fa07447a308bc421350 /lib/tapicero/couch_changes.rb
parent76b003ef7dcbeba19b3c592072cf537c0ae79221 (diff)
ignore design document changes - do not trigger callbacks then
tapicero should create per user databases when a user is created and destroy them when that user is destroyed. However it should not attempt the same if design docs are created or destroyed.
Diffstat (limited to 'lib/tapicero/couch_changes.rb')
-rw-r--r--lib/tapicero/couch_changes.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tapicero/couch_changes.rb b/lib/tapicero/couch_changes.rb
index b45d54a..aa21676 100644
--- a/lib/tapicero/couch_changes.rb
+++ b/lib/tapicero/couch_changes.rb
@@ -45,6 +45,8 @@ module Tapicero
def callbacks(hash)
#changed callback
+ # let's not track design document changes
+ return if hash['id'].start_with? '_design/'
return unless changes = hash["changes"]
return deleted(hash) if hash["deleted"]
created(hash) if changes[0]["rev"].start_with?('1-')