diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5df5866 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/doc diff --git a/README.rdoc b/README.rdoc index 0741531..95b5bfa 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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