From 2082c491fa9cada7c073ed95857b66437d9ae6a1 Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Sat, 13 Sep 2008 23:54:39 -0400 Subject: [PATCH] this may fix the attachment erase problem on couchview --- lib/couchrest/helper/file_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/couchrest/helper/file_manager.rb b/lib/couchrest/helper/file_manager.rb index e41940e..a3e798a 100644 --- a/lib/couchrest/helper/file_manager.rb +++ b/lib/couchrest/helper/file_manager.rb @@ -206,7 +206,7 @@ module CouchRest existing = @db.get(id) rescue nil if existing - updated = fields.merge({"_id" => id, "_rev" => existing["_rev"]}) + updated = existing.merge(fields) if existing != updated say "replacing #{id}" db.save(updated)