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:
parent
1c43a8f3d3
commit
b5d6baaf11
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue