Skip to content

Commit

Permalink
Load trilogy adapter after rails
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed Jul 23, 2024
1 parent c8958f0 commit c2ab69a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
appraise 'rails-6-1' do
gem 'activerecord-trilogy-adapter', '>= 3.1.2', require: false
gem 'rails', '6.1.7.6'
gem 'activerecord-trilogy-adapter', '>= 3.1.2'
end

appraise 'rails-7-0' do
gem 'activerecord-trilogy-adapter', '>= 3.1.2', require: false
gem 'rails', '7.0.8'
gem 'activerecord-trilogy-adapter', '>= 3.1.2'
end

appraise 'rails-7-1' do
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'activerecord-trilogy-adapter', '>= 3.1.2'
gem 'activerecord-trilogy-adapter', '>= 3.1.2', require: false
gem 'codeclimate-test-reporter', '~> 1.0.3', group: :test, require: nil
gem 'rails', '6.1.7.6'
gem 'rubocop', '~> 1.60.2', require: false
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'activerecord-trilogy-adapter', '>= 3.1.2'
gem 'activerecord-trilogy-adapter', '>= 3.1.2', require: false
gem 'codeclimate-test-reporter', '~> 1.0.3', group: :test, require: nil
gem 'rails', '7.0.8'
gem 'rubocop', '~> 1.60.2', require: false
Expand Down
8 changes: 6 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

db_config = Configuration.new

require "active_record/connection_adapters/#{db_config['original_adapter']}_adapter"
begin
require 'activerecord-trilogy-adapter'
rescue StandardError
puts "'activerecord-trilogy-adapter' not loaded for #{Rails.version}"
end

# Disables/enables the queries log you see in your rails server in dev mode
fd = ENV['VERBOSE'] ? STDOUT : '/dev/null'
Expand All @@ -33,7 +37,7 @@
username: db_config['username'],
password: db_config['password'],
database: db_config['database'],
ssl_mode: "required"
ssl_mode: 'required'
)

MIGRATION_FIXTURES = File.expand_path('../fixtures/migrate/', __FILE__)
Expand Down

0 comments on commit c2ab69a

Please sign in to comment.