Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Documented connections management method
Browse files Browse the repository at this point in the history
  • Loading branch information
kovyrin committed Aug 16, 2009
1 parent 9004308 commit 16694cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/doc
18 changes: 17 additions & 1 deletion README.rdoc
Expand Up @@ -11,7 +11,23 @@

== Easy ActiveRecord Connection Management

FIXME: To be added
As a part of this plugin we've added +switch_connection_to+ method that accepts many different kinds
of db connections and uses them on a model. We support:

1. Strings and symbols as the names of connection configuration blocks in database.yml.
2. ActiveRecord models (we'd use connection currently set up on a model).
3. Database connections (Model.connection)
4. Nil values to reset model to default connection.

Sample code:

class Foo < ActiveRecord::Model; end

Foo.switch_connection_to(:blah)
Foo.switch_connection_to('foo')
Foo.switch_connection_to(Bar)
Foo.switch_connection_to(Baz.connection)
Foo.switch_connection_to(nil)


== DB Magic Method
Expand Down

0 comments on commit 16694cc

Please sign in to comment.