lib/couchrest/mixins/design_doc.rb in norr-couchrest-0.33.02 vs lib/couchrest/mixins/design_doc.rb in norr-couchrest-0.33.06

- old
+ new

@@ -28,14 +28,17 @@ self.design_doc_slug_cache = self.to_s end def default_design_doc { - "language" => "ruby", + "language" => "javascript", "views" => { 'all' => { - 'map' => "proc {|doc|emit(nil,1) if doc['couchrest-type'].eql?('#{self.to_s}')}", - 'reduce' => "proc{|ks,vs,rereduce|sum(vs)}" + 'map' => "function(doc) { + if (doc['couchrest-type'] == '#{self.to_s}') { + emit(doc['_id'],1); + } + }" } } } end \ No newline at end of file