Class: DatabaseCleaner::MongoMapper::Truncation

Inherits:
TruncationBase show all
Defined in:
lib/database_cleaner/mongo_mapper/truncation.rb

Instance Method Summary collapse

Methods inherited from TruncationBase

#initialize, #start

Constructor Details

This class inherits a constructor from DatabaseCleaner::TruncationBase

Instance Method Details

#cleanObject



6
7
8
9
10
11
12
13
# File 'lib/database_cleaner/mongo_mapper/truncation.rb', line 6

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