Permalink
Browse files

no, it was _rev that i wasn't updating

  • Loading branch information...
1 parent 0e6c69b commit a6e83b7a3202439e0849e65a7ef718552f9e703c @dominictarr committed Jun 5, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 server.js
View
@@ -52,10 +52,12 @@ function save (repo){
repo.saving = true
db.get('' + repo._id, function (err,doc){
- var obj = {_id: doc._id}
+
+ var obj = {}
for (var key in repo)
obj[key] = repo[key]
- delete obj._events
+ obj._rev = doc && doc._rev
+ obj.time = new Date()
db.save(obj,
function (err,data){
repo._rev = data._rev

0 comments on commit a6e83b7

Please sign in to comment.