Save on Document & ExtendedDocument crashed if bulk

- document#save expects to receive {"ok" => true} even with bulk mode
- ExtendedDocument#save_without_callbacks reverted to previous code
  (expecting result["ok"] as in create_without_callbacks)
This commit is contained in:
Julien Sanchez 2009-10-12 19:55:02 +08:00 committed by Matt Aimonetti
parent 1c43a8f3d3
commit b5d6baaf11
2 changed files with 2 additions and 2 deletions

View file

@ -145,7 +145,7 @@ module CouchRest
end
if bulk
@bulk_save_cache << doc
return bulk_save if @bulk_save_cache.length >= @bulk_save_cache_limit
bulk_save if @bulk_save_cache.length >= @bulk_save_cache_limit
return {"ok" => true} # Compatibility with Document#save
elsif !bulk && @bulk_save_cache.length > 0
bulk_save

View file

@ -238,7 +238,7 @@ module CouchRest
set_unique_id if new? && self.respond_to?(:set_unique_id)
result = database.save_doc(self, bulk)
mark_as_saved
true
result["ok"] == true
end
# Saves the document to the db using save. Raises an exception