diff --git a/lib/couchrest/core/database.rb b/lib/couchrest/core/database.rb index 2fb722a..96c4a0d 100644 --- a/lib/couchrest/core/database.rb +++ b/lib/couchrest/core/database.rb @@ -145,7 +145,7 @@ def save_doc(doc, bulk = false) 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 diff --git a/lib/couchrest/more/extended_document.rb b/lib/couchrest/more/extended_document.rb index 351c344..f33481d 100644 --- a/lib/couchrest/more/extended_document.rb +++ b/lib/couchrest/more/extended_document.rb @@ -238,7 +238,7 @@ def save_without_callbacks(bulk = false) 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