Class: DatabaseCleaner::ActiveRecord::Deletion

Inherits:
Truncation
  • Object
show all
Defined in:
lib/database_cleaner/active_record/deletion.rb

Instance Attribute Summary

Attributes included from Base

#connection_hash

Instance Method Summary collapse

Methods included from Generic::Truncation

#initialize, #start

Methods included from Base

#connection_klass, #create_connection_klass, #db, #db=, #load_config

Methods included from Generic::Base

#db, included

Instance Method Details

#cleanObject



55
56
57
58
59
60
61
62
# File 'lib/database_cleaner/active_record/deletion.rb', line 55

def clean
  connection = connection_klass.connection
  connection.disable_referential_integrity do
    tables_to_truncate(connection).each do |table_name|
      connection.delete_table table_name
    end
  end
end