diff options
author | deathbearbrown <deathbearbrown@gmail.com> | 2014-05-20 12:19:42 -0400 |
---|---|---|
committer | deathbearbrown <deathbearbrown@gmail.com> | 2014-05-20 12:19:42 -0400 |
commit | aefff2084aa2e9fde42207561dfc23f4d8e988b6 (patch) | |
tree | f5e64c81e8283adc7a600615ce1dea590e5cf028 | |
parent | 2abdb2cca937ca4551edb92bba8066672033042f (diff) | |
download | couchdb-Fix-For-ids-in-docs.tar.gz |
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.Fix-For-ids-in-docs
Couchdb and backbone don't mesh well when it comes to naming conventions.
-rw-r--r-- | src/fauxton/app/addons/documents/resources.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js index 99e79a2ab..9b15f6cd3 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; |