Skip to content

Commit

Permalink
update readme, first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Aug 8, 2010
1 parent 7ea457d commit 5167a85
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.textile
Expand Up @@ -76,7 +76,53 @@ end

For use in Cucumber please see the section below.

h2. How to use with multiple ORM's

Sometimes you need to use multiple ORMs in your application. You can use DatabaseCleaner to clean multiple ORMs, and multiple connections for those ORMs.

<pre>
#How to specify particular orms
DatabaseCleaner[:active_record].strategy = :transaction
DatabaseCleaner[:mongo_mapper].strategy = :truncation

#How to specify particular connections
DatabaseCleaner[:active_record,{:connection => :two}]
</pre>

Usage beyond that remains the same with DatabaseCleaner.start calling any setup on the different configured connections, and DatabaseCleaner.clean executing afterwards.

Configuration options
<table>
<tr>
<th>ORM</th>
<th>How to access</th>
<th>Notes</th>
</tr>
<tr>
<td>Active Record</td>
<td>DatabaseCleaner[:active_record]</td>
<td>Connection specified as :symbol keys, loaded from config/database.yml</td>
</th>
<tr>
<td>Data Mapper</td>
<td>DatabaseCleaner[:data_mapper]</td>
<td>Connection specified as :symbol keys, loaded via Datamapper repositories</td>
</th>
<tr>
<td>Mongo Mapper</td>
<td>DatabaseCleaner[:mongo_mapper]</td>
<td>Multiple connections not yet supported</td>
</th>
<tr>
<td>Mongoid</td>
<td>DatabaseCleaner[:mongoid]</td>
<td>Multiple connections not yet supported</td>
</th>
<tr>
<td>Couch Potato</td>
<td>DatabaseCleaner[:couch_potato]</td>
<td>Multiple connections not yet supported</td>
</th>

h2. Why?

Expand Down

0 comments on commit 5167a85

Please sign in to comment.