ClassProxy provides class-level methods on a dynamically chosen database.
Examples: db = CouchRest::Database.new(...) articles = Article.on(db) articles.all { ... } articles.by_title { ... } u = articles.get("someid") u = articles.new(:title => "I like plankton") u.save # saved on the correct database
This commit is contained in:
parent
af6ac7df89
commit
c4b49baecf
4 changed files with 180 additions and 1 deletions
|
@ -11,6 +11,7 @@ module CouchRest
|
|||
include CouchRest::Mixins::Views
|
||||
include CouchRest::Mixins::DesignDoc
|
||||
include CouchRest::Mixins::ExtendedAttachments
|
||||
include CouchRest::Mixins::ClassProxy
|
||||
|
||||
def self.inherited(subklass)
|
||||
subklass.send(:include, CouchRest::Mixins::Properties)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue