Skip to content

Commit

Permalink
when running tests we need to ensure AR is aware of Trilogy
Browse files Browse the repository at this point in the history
so load it and make the DB connection
  • Loading branch information
zmariscal committed Sep 26, 2023
1 parent c95dc75 commit e5f311e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/abstract_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5f311e

Please sign in to comment.