Class: DatabaseCleaner::ActiveRecord::Deletion
- Inherits:
-
Truncation
- Object
- Truncation
- DatabaseCleaner::ActiveRecord::Deletion
- Includes:
- SelectiveTruncation
- Defined in:
- lib/database_cleaner/active_record/deletion.rb
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from SelectiveTruncation
#information_schema_exists?, #tables_to_truncate, #tables_with_new_rows
Methods included from Generic::Truncation
Methods included from Base
#connection_class, #db, #db=, #load_config, #valid_config
Methods included from Generic::Base
Instance Method Details
#clean ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/database_cleaner/active_record/deletion.rb', line 77 def clean connection = connection_class.connection connection.disable_referential_integrity do tables_to_truncate(connection).each do |table_name| connection.delete_table table_name end end end |