Skip to content

Commit c543ea0

Browse files
committed
remove now useless const + with_multi_statements
1 parent 96c5443 commit c543ea0

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

lib/active_record/connection_adapters/cockroachdb/database_statements.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ def insert_fixtures_set(fixture_set, tables_to_delete = [])
2424
table_deletes = tables_to_delete.map { |table| "DELETE FROM #{quote_table_name(table)}" }
2525
statements = table_deletes + fixture_inserts
2626

27-
with_multi_statements do
28-
disable_referential_integrity do
29-
execute_batch(statements, "Fixtures Load")
30-
end
27+
disable_referential_integrity do
28+
execute_batch(statements, "Fixtures Load")
3129
end
3230
end
3331
end

test/cases/helper_cockroachdb.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,13 @@
1717
# and COCKROACH_SKIP_LOAD_SCHEMA that can
1818
# skip this step
1919
require "support/load_schema_helper"
20-
class NoPGSchemaTestCase < SimpleDelegator
21-
def current_adapter?(...)
22-
false
23-
end
24-
end
2520

2621
module LoadSchemaHelperExt
2722
def load_schema
28-
# TODO: Remove this const_set mess once https://github.com/rails/rails/commit/d5c2ff8345c9d23b7326edb2bbe72b6e86a63140
29-
# is part of a rails release.
30-
old_helper = ActiveRecord::TestCase
31-
ActiveRecord.const_set(:TestCase, NoPGSchemaTestCase.new(ActiveRecord::TestCase))
3223
return if ENV['COCKROACH_LOAD_FROM_TEMPLATE']
3324
return if ENV['COCKROACH_SKIP_LOAD_SCHEMA']
3425

3526
super
36-
ensure
37-
ActiveRecord.const_set(:TestCase, old_helper)
3827
end
3928
end
4029
LoadSchemaHelper.prepend(LoadSchemaHelperExt)

0 commit comments

Comments
 (0)