Module: ActiveRecord::ConnectionAdapters::CockroachDB::DatabaseStatements
- Included in:
- ActiveRecord::ConnectionAdapters::CockroachDBAdapter
- Defined in:
- lib/active_record/connection_adapters/cockroachdb/database_statements.rb
Instance Method Summary collapse
-
#insert_fixtures_set(fixture_set, tables_to_delete = []) ⇒ Object
Overridden to avoid using transactions for schema creation.
Instance Method Details
#insert_fixtures_set(fixture_set, tables_to_delete = []) ⇒ Object
Overridden to avoid using transactions for schema creation.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/active_record/connection_adapters/cockroachdb/database_statements.rb', line 22 def insert_fixtures_set(fixture_set, tables_to_delete = []) fixture_inserts = build_fixture_statements(fixture_set) table_deletes = tables_to_delete.map { |table| "DELETE FROM #{quote_table_name(table)}" } statements = table_deletes + fixture_inserts with_multi_statements do disable_referential_integrity do execute_batch(statements, "Fixtures Load") end end end |