documentation model

This commit is contained in:
Chris Anderson 2008-10-03 11:11:06 -07:00
parent 32bf8715e1
commit 1e9e550428

View file

@ -86,12 +86,15 @@ module CouchRest
self.class_database || CouchRest::Model.default_database
end
# load a document from the database
# Load a document from the database by id
def get id
doc = database.get id
new(doc)
end
# Load all documents that have the "couchrest-type" field equal to the
# name of the current class. Take thes the standard set of
# CouchRest::Database#view options.
def all opts = {}
self.generated_design_doc ||= default_design_doc
unless design_doc_fresh