Class: DatabaseCleaner::DataMapper::Truncation

Inherits:
Object
  • Object
show all
Includes:
Base, Generic::Truncation
Defined in:
lib/database_cleaner/data_mapper/truncation.rb

Instance Method Summary collapse

Methods included from Generic::Truncation

#initialize, #start

Methods included from Base

#db, #db=

Methods included from Generic::Base

#cleaning, #db, included

Instance Method Details

#clean(repository = self.db) ⇒ Object



189
190
191
192
193
194
# File 'lib/database_cleaner/data_mapper/truncation.rb', line 189

def clean(repository = self.db)
  adapter = ::DataMapper.repository(repository).adapter
  adapter.disable_referential_integrity do
    adapter.truncate_tables(tables_to_truncate(repository))
  end
end