| Module | CouchRest::Model::Persistence |
| In: |
lib/couchrest/model/persistence.rb
|
Create the document. Validation is enabled by default and will return false if the document is not valid. If all goes well, the document will be returned.
Reloads the attributes of this object from the database. It doesn‘t override custom instance variables.
Returns self.
Saves the document to the db using save. Raises an exception if the document is not saved properly.
Update the document‘s attributes and save. For example:
doc.update_attributes :name => "Fred"
Is the equivilent of doing the following:
doc.attributes = { :name => "Fred" }
doc.save