Module: DatabaseCleaner::Mongo::TruncationMixin

Included in:
Truncation, DatabaseCleaner::MongoMapper::Truncation, DatabaseCleaner::Mongoid::Truncation
Defined in:
lib/database_cleaner/mongo/truncation_mixin.rb

Instance Method Summary collapse

Instance Method Details

#cleanObject



5
6
7
8
9
10
11
12
# File 'lib/database_cleaner/mongo/truncation_mixin.rb', line 5

def clean
  if @only
    collections.each { |c| c.remove if @only.include?(c.name) }
  else
    collections.each { |c| c.remove unless @tables_to_exclude.include?(c.name) }
  end
  true
end