Class: DatabaseCleaner::DataMapper::Truncation
- Inherits:
-
Object
- Object
- DatabaseCleaner::DataMapper::Truncation
- Includes:
- Base, Generic::Truncation
- Defined in:
- lib/database_cleaner/data_mapper/truncation.rb
Instance Method Summary collapse
Methods included from Generic::Truncation
Methods included from Base
Methods included from Generic::Base
Instance Method Details
#clean(repository = self.db) ⇒ Object
153 154 155 156 157 158 159 160 |
# File 'lib/database_cleaner/data_mapper/truncation.rb', line 153 def clean(repository = self.db) adapter = ::DataMapper.repository(repository).adapter adapter.disable_referential_integrity do tables_to_truncate(repository).each do |table_name| adapter.truncate_table table_name end end end |