From 7b3e16afc5b3368bfd1542f8a3005e3a560e955c Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Wed, 4 Sep 2024 10:17:42 -0400 Subject: [PATCH 1/3] Add tests for AR 7.2 and remove upper version limit Signed-off-by: Jordan Hollinger --- Appraisals | 4 ++++ blueprinter-activerecord.gemspec | 2 +- gemfiles/ar_7.2.gemfile | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 gemfiles/ar_7.2.gemfile diff --git a/Appraisals b/Appraisals index b0adbc7..826bb0a 100644 --- a/Appraisals +++ b/Appraisals @@ -1,5 +1,9 @@ # frozen_string_literal: true +appraise "ar-7.2" do + gem "activerecord", "~> 7.2.1" +end + appraise "ar-7.1" do gem "activerecord", "~> 7.1.1" end diff --git a/blueprinter-activerecord.gemspec b/blueprinter-activerecord.gemspec index bc39dfa..48371ed 100644 --- a/blueprinter-activerecord.gemspec +++ b/blueprinter-activerecord.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.files = Dir['lib/**/*'] spec.require_paths = ['lib'] - spec.add_runtime_dependency 'activerecord', ['>= 6.0', '< 7.2'] + spec.add_runtime_dependency 'activerecord', ['>= 6.0'] spec.add_runtime_dependency 'blueprinter', '~> 1.0' spec.add_development_dependency 'appraisal', '~> 2.5' diff --git a/gemfiles/ar_7.2.gemfile b/gemfiles/ar_7.2.gemfile new file mode 100644 index 0000000..b36145c --- /dev/null +++ b/gemfiles/ar_7.2.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", "~> 7.2.1" + +gemspec path: "../" From 824137dcf0318fe34792f874d684177133e33693 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Wed, 4 Sep 2024 10:25:10 -0400 Subject: [PATCH 2/3] Version 1.3.0 Signed-off-by: Jordan Hollinger --- CHANGELOG.md | 5 +++++ lib/blueprinter-activerecord/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f734a6..b22cf33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 1.3.0 (2024-09-04) + +- Support ActiveRecord 7.2 +- Remove restrictions on future ActiveRecord versions + ### 1.2.0 (2024-06-26) - [BUGFIX] Fixes an issue where an association wouldn't be preloaded if it used a dynamic blueprint. diff --git a/lib/blueprinter-activerecord/version.rb b/lib/blueprinter-activerecord/version.rb index 4b90bd3..421e602 100644 --- a/lib/blueprinter-activerecord/version.rb +++ b/lib/blueprinter-activerecord/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module BlueprinterActiveRecord - VERSION = "1.2.0" + VERSION = "1.3.0" end From f1561617c02d386ece43ba2588e5c348e9c7b570 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Wed, 4 Sep 2024 10:40:43 -0400 Subject: [PATCH 3/3] Don't test AR 7.2 on Ruby 3.0 (not supported) Signed-off-by: Jordan Hollinger --- .github/workflows/test.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5ef524c..dab88e9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,11 +7,11 @@ on: permissions: contents: read jobs: - test: + test-current: strategy: matrix: os: [ubuntu-latest] - ruby: ["3.0", "3.1", "3.2", "3.3"] + ruby: ["3.1", "3.2", "3.3"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 @@ -26,3 +26,28 @@ jobs: bundle exec appraisal install --path=vendor/bundle - name: Run tests run: bundle exec appraisal rake test + + test-3_0: + strategy: + matrix: + os: [ubuntu-latest] + ruby: ["3.0"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - name: Set up Ruby ${{ matrix.ruby }} + uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Installing dependencies + run: | + bundle check --path=vendor/bundle || bundle install --path=vendor/bundle + bundle exec appraisal ar-6.1 bundle install --path=vendor/bundle + bundle exec appraisal ar-7.0 bundle install --path=vendor/bundle + bundle exec appraisal ar-7.1 bundle install --path=vendor/bundle + - name: Run tests + run: | + bundle exec appraisal ar-6.1 rake test + bundle exec appraisal ar-7.0 rake test + bundle exec appraisal ar-7.1 rake test