From 5258a0ba52ddbe9ea3f205996d50eaeeddc48a00 Mon Sep 17 00:00:00 2001 From: Matt Aimonetti Date: Mon, 2 Mar 2009 21:21:59 -0800 Subject: [PATCH] fixed a bug where :include_docs on a view couldn't be overwritten --- lib/couchrest/mixins/views.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/couchrest/mixins/views.rb b/lib/couchrest/mixins/views.rb index 20dd157..fb9269c 100644 --- a/lib/couchrest/mixins/views.rb +++ b/lib/couchrest/mixins/views.rb @@ -133,7 +133,9 @@ module CouchRest fetch_view(name, opts, &block) else begin - view = fetch_view name, opts.merge({:include_docs => true}), &block + # auto load mentioned documents unless asked differently + opts.merge({:include_docs => true}) unless opts.has_key?(:include_docs) + view = fetch_view name, opts, &block view['rows'].collect{|r|new(r['doc'])} if view['rows'] rescue # fallback for old versions of couchdb that don't