From 73f6481768da6e385223167d967297b9dfc451de Mon Sep 17 00:00:00 2001 From: David Rice Date: Wed, 7 Dec 2016 16:22:53 +0000 Subject: [PATCH] Allow override of :all view. Only apply default :map if the option is not passed. --- lib/couchrest/model/designs/view.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/couchrest/model/designs/view.rb b/lib/couchrest/model/designs/view.rb index a0f3eb9c..56507b80 100644 --- a/lib/couchrest/model/designs/view.rb +++ b/lib/couchrest/model/designs/view.rb @@ -485,7 +485,7 @@ def define(design_doc, name, opts = {}) model = design_doc.model # Is this an all view? - if name.to_s == 'all' + if name.to_s == 'all' && !opts[:map] opts[:map] = <<-EOF function(doc) { if (doc['#{model.model_type_key}'] == '#{model.model_type_value}') {