added model#save! raising an exception if the document isn't saved properly
This commit is contained in:
parent
19f587c0d6
commit
b1315d20f4
2 changed files with 31 additions and 0 deletions
|
@ -459,6 +459,12 @@ module CouchRest
|
|||
update
|
||||
end
|
||||
end
|
||||
|
||||
# Saves the document to the db using create or update. Raises an exception
|
||||
# if the document is not saved properly.
|
||||
def save!
|
||||
raise "#{self.inspect} failed to save" unless self.save
|
||||
end
|
||||
|
||||
# Deletes the document from the database. Runs the :delete callbacks.
|
||||
# Removes the <tt>_id</tt> and <tt>_rev</tt> fields, preparing the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue