updates for qr handling

This commit is contained in:
2012-08-27 15:46:18 +02:00
parent c087aa0267
commit 157b2406a0
14 changed files with 79 additions and 36 deletions
+2 -2
View File
@@ -12,12 +12,12 @@ class Table
view :active_lists, type: :custom, map_function: %|function(doc){
if(doc.ruby_class == 'List' && doc.state == 'active'){
emit(doc._id, 1);
emit(doc.table_id, 1);
}
}|, reduce_function: '_sum'
def occupied?
not self.class.database.view(self.class.active_lists(key: list_id, reduce: true)).zero?
not self.class.database.view(self.class.active_lists(key: id, reduce: true)).zero?
end
end