From e5f311e2ab61a917613055b44bd0e1a4dbd63a5b Mon Sep 17 00:00:00 2001 From: Zack Mariscal Date: Mon, 25 Sep 2023 21:26:00 -0700 Subject: [PATCH] when running tests we need to ensure AR is aware of Trilogy so load it and make the DB connection --- test/abstract_unit.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/abstract_unit.rb b/test/abstract_unit.rb index cbb14f46..4645bf38 100644 --- a/test/abstract_unit.rb +++ b/test/abstract_unit.rb @@ -14,6 +14,12 @@ puts "Loaded #{spec_name}" # And now connect to the database +if spec_name == "trilogy" + require "activerecord-trilogy-adapter" + require "trilogy_adapter/connection" + ActiveRecord::Base.extend TrilogyAdapter::Connection +end + ActiveRecord::Base.establish_connection(spec) # Tell active record about the configuration