Skip to content

Commit

Permalink
cheat on current_adapter stuff, for now
Browse files Browse the repository at this point in the history
  • Loading branch information
BuonOmo committed Aug 27, 2024
1 parent b410a10 commit 218de51
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/cases/helper_cockroachdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,23 @@
# and COCKROACH_SKIP_LOAD_SCHEMA that can
# skip this step
require "support/load_schema_helper"
class NoPGSchemaTestCase < SimpleDelegator
def current_adapter?(...)
puts ?» * 80
false
end
end

module LoadSchemaHelperExt
def load_schema
old_helper = ActiveRecord::TestCase
ActiveRecord.const_set(:TestCase, NoPGSchemaTestCase.new(ActiveRecord::TestCase))
return if ENV['COCKROACH_LOAD_FROM_TEMPLATE']
return if ENV['COCKROACH_SKIP_LOAD_SCHEMA']

super
ensure
ActiveRecord.const_set(:TestCase, old_helper)
end
end
LoadSchemaHelper.prepend(LoadSchemaHelperExt)
Expand Down

0 comments on commit 218de51

Please sign in to comment.