| Module | CouchRest::Mixins::ClassProxy::ClassMethods |
| In: |
lib/couchrest/mixins/class_proxy.rb
|
Return a proxy object which represents a model class on a chosen database instance. This allows you to DRY operations where a database is chosen dynamically.
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