couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [2/2] fabric commit: updated refs/heads/master to adaf5c2
Date Tue, 03 Feb 2015 16:10:30 GMT
Respect doc_options during _changes serialization

When including full documents in the changes feed response, respect
doc_options (e.g. attachments=true) during JSON serialization.

This closes #12

COUCHDB-2522

Signed-off-by: Alexander Shorin <kxepal@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/adaf5c23
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/adaf5c23
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/adaf5c23

Branch: refs/heads/master
Commit: adaf5c231537e0b34f456a2c91f54297223c753f
Parents: eb0f5cb
Author: Will Holley <willholley@gmail.com>
Authored: Mon Feb 2 21:02:27 2015 +0000
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Tue Feb 3 19:09:25 2015 +0300

----------------------------------------------------------------------
 src/fabric_rpc.erl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/adaf5c23/src/fabric_rpc.erl
----------------------------------------------------------------------
diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl
index 4a7881a..eeaebd1 100644
--- a/src/fabric_rpc.erl
+++ b/src/fabric_rpc.erl
@@ -301,7 +301,8 @@ changes_enumerator(DocInfo, Acc) ->
         args = #changes_args{
             include_docs = IncludeDocs,
             conflicts = Conflicts,
-            filter_fun = Filter
+            filter_fun = Filter,
+            doc_options = DocOptions
         },
         pending = Pending,
         epochs = Epochs
@@ -311,7 +312,7 @@ changes_enumerator(DocInfo, Acc) ->
     [] ->
         {ok, Acc#cacc{seq = Seq, pending = Pending-1}};
     Results ->
-        Opts = if Conflicts -> [conflicts]; true -> [] end,
+        Opts = if Conflicts -> [conflicts | DocOptions]; true -> DocOptions end,
         ChangesRow = {change, [
 	    {pending, Pending-1},
             {seq, {Seq, uuid(Db), owner_of(Seq, Epochs)}},
@@ -327,7 +328,7 @@ changes_enumerator(DocInfo, Acc) ->
 doc_member(Shard, DocInfo, Opts) ->
     case couch_db:open_doc(Shard, DocInfo, [deleted | Opts]) of
     {ok, Doc} ->
-        {doc, couch_doc:to_json_obj(Doc, [])};
+        {doc, couch_doc:to_json_obj(Doc, Opts)};
     Error ->
         Error
     end.


Mime
View raw message