From b4bac83a63706d1119b12726c8a88c006f57f9a3 Mon Sep 17 00:00:00 2001 From: Allen C Date: Sat, 25 Dec 2021 15:59:38 +0800 Subject: [PATCH 1/3] add rails 7 support --- .travis.yml | 0 Appraisals | 4 ++-- gemfiles/gemfile_70.gemfile | 10 ++++++++++ lib/ancestry/version.rb | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) delete mode 100644 .travis.yml create mode 100644 gemfiles/gemfile_70.gemfile diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/Appraisals b/Appraisals index 3b37427f..4cd0f419 100644 --- a/Appraisals +++ b/Appraisals @@ -1,5 +1,5 @@ -%w(5.2.6 6.0.3 6.1.3).each do |ar_version| +%w[5.2.6 6.0.3 6.1.3 7.0.0].each do |ar_version| appraise "gemfile-#{ar_version.split('.').first(2).join}" do - gem "activerecord", "~> #{ar_version}" + gem 'activerecord', "~> #{ar_version}" end end diff --git a/gemfiles/gemfile_70.gemfile b/gemfiles/gemfile_70.gemfile new file mode 100644 index 00000000..8bf730d8 --- /dev/null +++ b/gemfiles/gemfile_70.gemfile @@ -0,0 +1,10 @@ +# This file was generated by Appraisal + +source 'https://rubygems.org' + +gem 'activerecord', '~> 7.0.0' +gem 'mysql2' +gem 'pg' +gem 'sqlite3' + +gemspec path: '../' diff --git a/lib/ancestry/version.rb b/lib/ancestry/version.rb index e1fcd01d..da60a3d4 100644 --- a/lib/ancestry/version.rb +++ b/lib/ancestry/version.rb @@ -1,3 +1,3 @@ module Ancestry - VERSION = "4.1.0" + VERSION = '4.1.1' end From 741d0456dab5f8b6bfc0a8d3efa9f6d372f9c7cb Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Thu, 9 Jun 2022 10:42:11 -0700 Subject: [PATCH 2/3] Add Rails 7 / Ruby 3.1 to the CI matrix --- .github/workflows/run_test_suite.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run_test_suite.yml b/.github/workflows/run_test_suite.yml index 58ddc3bc..806f12ba 100644 --- a/.github/workflows/run_test_suite.yml +++ b/.github/workflows/run_test_suite.yml @@ -45,6 +45,8 @@ jobs: activerecord: 61 - ruby: "3.0" activerecord: 61 + - ruby: 3.1 + activerecord: 70 env: # for the pg cli (psql, pg_isready) and possibly rails PGHOST: 127.0.0.1 # container is mapping it locally From 9a4a444705f826410174b7c792019cb8bdc7ddf1 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Thu, 9 Jun 2022 10:54:14 -0700 Subject: [PATCH 3/3] Support aliases in file load --- .github/workflows/run_test_suite.yml | 1 + test/environment.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_test_suite.yml b/.github/workflows/run_test_suite.yml index 806f12ba..633fc27a 100644 --- a/.github/workflows/run_test_suite.yml +++ b/.github/workflows/run_test_suite.yml @@ -35,6 +35,7 @@ jobs: --health-retries=3 runs-on: ubuntu-latest strategy: + fail-fast: false matrix: include: - ruby: 2.5 diff --git a/test/environment.rb b/test/environment.rb index 1a8e03c7..e1e2058f 100644 --- a/test/environment.rb +++ b/test/environment.rb @@ -34,7 +34,11 @@ def self.setup end # Setup database connection - all_config = YAML.load_file(filename) + all_config = if YAML.respond_to?(:safe_load_file) + YAML.safe_load_file(filename, aliases: true) + else + YAML.load_file(filename) + end config = all_config[db_type] if config.blank? $stderr.puts "","","ERROR: Could not find '#{db_type}' in #{filename}"