mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Updated regexp for filter system collections
Fixed cleaning collections with names like: favourite_systems operating_systems systems and so on. All real mongo's system collections have following name format (as in 2.4.1): {db_name}.system.{system_collection_type}
This commit is contained in:
parent
8d7f72ffc9
commit
1111b7fa9f
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ module DatabaseCleaner
|
||||||
session.use(db)
|
session.use(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
session['system.namespaces'].find(:name => { '$not' => /system|\$/ }).to_a.map do |collection|
|
session['system.namespaces'].find(:name => { '$not' => /\.system\.|\$/ }).to_a.map do |collection|
|
||||||
_, name = collection['name'].split('.', 2)
|
_, name = collection['name'].split('.', 2)
|
||||||
name
|
name
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue