diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 264af32..7f3f212 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,6 +16,7 @@ jobs: - '3.0' - '2.7' activerecord: + - '7.0' - '6.1' - '6.0' - '5.2' diff --git a/gemfiles/activerecord_7.0.gemfile b/gemfiles/activerecord_7.0.gemfile new file mode 100644 index 0000000..f38369b --- /dev/null +++ b/gemfiles/activerecord_7.0.gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gemspec path: "../" + +gem "activerecord", "~> 7.0.0" diff --git a/spec/support/database.rb b/spec/support/database.rb index e14397c..d9c5032 100644 --- a/spec/support/database.rb +++ b/spec/support/database.rb @@ -17,7 +17,8 @@ module ActiveRecord::Import::Connection ActiveRecord::Base.configurations = YAML.load_file(database_yml) ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), '../debug.log')) ActiveRecord::Base.logger.level = ENV['CI'] ? ::Logger::ERROR : ::Logger::DEBUG -config = ActiveRecord::Base.configurations[db_name] +configs = ActiveRecord::Base.configurations +config = configs.try(:find_db_config, db_name) || configs[db_name] begin ActiveRecord::Base.establish_connection(db_name.to_sym)