Class: ActiveRecord::ConnectionAdapters::JdbcAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- ActiveRecord::ConnectionAdapters::JdbcAdapter
- Defined in:
- lib/database_cleaner/active_record/deletion.rb,
lib/database_cleaner/active_record/truncation.rb
Instance Method Summary collapse
Methods inherited from AbstractAdapter
Instance Method Details
#delete_table(table_name) ⇒ Object
25 26 27 |
# File 'lib/database_cleaner/active_record/deletion.rb', line 25 def delete_table(table_name) execute("DELETE FROM #{quote_table_name(table_name)};") end |
#truncate_table(table_name) ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/database_cleaner/active_record/truncation.rb', line 71 def truncate_table(table_name) begin execute("TRUNCATE TABLE #{quote_table_name(table_name)};") rescue ActiveRecord::StatementInvalid execute("DELETE FROM #{quote_table_name(table_name)};") end end |