Class: ActiveRecord::ConnectionAdapters::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/database_cleaner/active_record/truncation.rb,
lib/database_cleaner/active_record/surgicalstrike.rb

Instance Method Summary collapse

Instance Method Details

#truncate_table(table_name) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/database_cleaner/active_record/truncation.rb', line 16

def truncate_table(table_name)
  raise NotImplementedError
end

#truncate_tables(tables) ⇒ Object



20
21
22
23
24
# File 'lib/database_cleaner/active_record/truncation.rb', line 20

def truncate_tables(tables)
  tables.each do |table_name|
    self.truncate_table(table_name)
  end
end

#viewsObject



12
13
14
# File 'lib/database_cleaner/active_record/truncation.rb', line 12

def views
  @views ||= select_values("select table_name from information_schema.views where table_schema = '#{current_database}'") rescue []
end