mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Merge pull request #149 from swiftype/master
Multiple database support for Mongoid 3
This commit is contained in:
commit
e1c3b908d5
2 changed files with 5 additions and 1 deletions
|
@ -202,7 +202,7 @@ Configuration options
|
|||
| Active Record | DatabaseCleaner[:active_record] | Connection specified as :symbol keys, loaded from config/database.yml. You may also pass in the ActiveRecord model under the @:model@ key. |
|
||||
| Data Mapper | DatabaseCleaner[:data_mapper] | Connection specified as :symbol keys, loaded via Datamapper repositories |
|
||||
| Mongo Mapper | DatabaseCleaner[:mongo_mapper] | Multiple connections not yet supported |
|
||||
| Mongoid | DatabaseCleaner[:mongoid] | Multiple connections not yet supported |
|
||||
| Mongoid | DatabaseCleaner[:mongoid] | Multiple databases supported for Mongoid 3. Specify DatabaseCleaner[:mongoid, {:connection => :db_name}] |
|
||||
| Couch Potato | DatabaseCleaner[:couch_potato] | Multiple connections not yet supported |
|
||||
| Sequel | DatabaseCleaner[:sequel] | ? |
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@ module DatabaseCleaner
|
|||
private
|
||||
|
||||
def collections
|
||||
if db != :default
|
||||
session.use(db)
|
||||
end
|
||||
|
||||
session['system.namespaces'].find(:name => { '$not' => /system|\$/ }).to_a.map do |collection|
|
||||
_, name = collection['name'].split('.', 2)
|
||||
name
|
||||
|
|
Loading…
Reference in a new issue