# File lib/couch_potato/database.rb, line 76 def save_document(document, validate = true, retries = 0, &block) begin block.call document if block save_document_without_conflict_handling(document, validate) rescue CouchRest::Conflict => e if block handle_write_conflict document, validate, retries, &block else raise CouchPotato::Conflict.new end end end