2019-05-20 16:03:59 -06:00
|
|
|
# Database Cleaner Adapter for Mongoid
|
2018-05-25 23:38:08 -07:00
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongoid.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongoid)
|
|
|
|
[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongoid/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongoid)
|
2018-05-25 23:38:08 -07:00
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
Clean your Mongoid databases with Database Cleaner.
|
2018-05-25 23:38:08 -07:00
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
See https://github.com/DatabaseCleaner/database_cleaner for more information.
|
2018-05-25 23:38:08 -07:00
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
## Installation
|
2018-05-25 23:38:08 -07:00
|
|
|
|
|
|
|
```ruby
|
2019-05-20 16:03:59 -06:00
|
|
|
# Gemfile
|
|
|
|
group :test do
|
|
|
|
gem 'database_cleaner-mongoid'
|
|
|
|
end
|
2018-05-25 23:38:08 -07:00
|
|
|
```
|
|
|
|
|
2019-05-20 16:21:44 -06:00
|
|
|
## Supported Strategies
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>Truncation</th>
|
|
|
|
<th>Transaction</th>
|
|
|
|
<th>Deletion</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td> <b>Yes</b></td>
|
|
|
|
<td> No</td>
|
|
|
|
<td> No</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
(Default strategy is denoted in bold)
|
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
## Configuration options
|
2019-05-20 11:50:40 -06:00
|
|
|
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>ORM</th>
|
|
|
|
<th>How to access</th>
|
|
|
|
<th>Notes</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td> Mongoid</td>
|
|
|
|
<td> <code>DatabaseCleaner[:mongoid]</code></td>
|
|
|
|
<td> Multiple databases supported for Mongoid 3. Specify <code>DatabaseCleaner[:mongoid, {:connection => :db_name}]</code> </td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-05-25 23:38:08 -07:00
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
## COPYRIGHT
|
2018-05-25 23:38:08 -07:00
|
|
|
|
2019-05-20 16:03:59 -06:00
|
|
|
See [LICENSE] for details.
|