couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject couchdb commit: updated refs/heads/Fix-For-ids-in-docs to aefff20
Date Tue, 20 May 2014 16:20:03 GMT
Repository: couchdb
Updated Branches:
  refs/heads/Fix-For-ids-in-docs [created] aefff2084


Originally resp.id was being deleted which is the wrong thing to do because a user can have
the "id" key in a document. Therefore their data was not being properly displayed and I removed
that delete.

Couchdb and backbone don't mesh well when it comes to naming conventions.


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

Branch: refs/heads/Fix-For-ids-in-docs
Commit: aefff2084aa2e9fde42207561dfc23f4d8e988b6
Parents: 2abdb2c
Author: deathbearbrown <deathbearbrown@gmail.com>
Authored: Tue May 20 12:19:42 2014 -0400
Committer: deathbearbrown <deathbearbrown@gmail.com>
Committed: Tue May 20 12:19:42 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/resources.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/aefff208/src/fauxton/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js
index 99e79a2..9b15f6c 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -41,7 +41,8 @@ function(app, FauxtonAPI, PagingCollection) {
     };
   })();
 
-  
+
+
   Documents.Doc = FauxtonAPI.Model.extend({
     idAttribute: "_id",
     documentation: function(){
@@ -191,6 +192,10 @@ function(app, FauxtonAPI, PagingCollection) {
         if (typeof(this.id) === "undefined") {
           resp._id = resp.id;
         }
+        if (!resp._id){
+          delete resp.id;
+        }
+
       }
       if (resp.ok) {
         delete resp.ok;


Mime
View raw message