From 1e9e55042835dab9dc76102cc341512eb797560e Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Fri, 3 Oct 2008 11:11:06 -0700 Subject: [PATCH] documentation model --- lib/couchrest/core/model.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/couchrest/core/model.rb b/lib/couchrest/core/model.rb index e8328f9..4e38674 100644 --- a/lib/couchrest/core/model.rb +++ b/lib/couchrest/core/model.rb @@ -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