Removed model create/update callbacks and integrated with new bulk save infrastructure.

This commit is contained in:
Nolan Darilek 2008-12-15 10:27:53 -06:00
parent d8d5645ebd
commit 84382d8af4
5 changed files with 33 additions and 37 deletions

View file

@ -35,9 +35,10 @@ module CouchRest
# Saves the document to the db using create or update. Also runs the :save
# callbacks. Sets the <tt>_id</tt> and <tt>_rev</tt> fields based on
# CouchDB's response.
def save
# If <tt>bulk</tt> is <tt>true</tt> (defaults to false) the document is cached for bulk save.
def save(bulk = false)
raise ArgumentError, "doc.database required for saving" unless database
result = database.save self
result = database.save self, bulk
result['ok']
end
@ -57,4 +58,4 @@ module CouchRest
end
end
end