module DatabaseCleaner::ConnectionAdapters::AbstractAdapter
Public Instance Methods
database_cleaner_table_cache()
click to toggle source
# File lib/database_cleaner/active_record/truncation.rb, line 28 def database_cleaner_table_cache # the adapters don't do caching (#130) but we make the assumption that the list stays the same in tests @database_cleaner_tables ||= tables end
database_cleaner_view_cache()
click to toggle source
used to be called views but that can clash with gems like schema_plus this gem is not meant to be exposing such an extra interface any way
# File lib/database_cleaner/active_record/truncation.rb, line 24 def database_cleaner_view_cache @views ||= select_values("select table_name from information_schema.views where table_schema = '#{current_database}'") rescue [] end
truncate_table(table_name)
click to toggle source
# File lib/database_cleaner/active_record/truncation.rb, line 33 def truncate_table(table_name) raise NotImplementedError end
truncate_tables(tables)
click to toggle source
# File lib/database_cleaner/active_record/truncation.rb, line 37 def truncate_tables(tables) tables.each do |table_name| self.truncate_table(table_name) end end