From 6160b4264a7292feb0d59ded0c34a8879fb78a37 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Mon, 9 Oct 2023 15:48:35 -0700 Subject: [PATCH 01/10] Change GitHub Actions to run on ubuntu-20.04 --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a9324a0..70aec55 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,7 +9,7 @@ on: jobs: test: name: Ruby ${{ matrix.ruby }} with ${{ matrix.gemfile }} - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 continue-on-error: ${{ contains(matrix.ruby, 'head') || contains(matrix.gemfile, 'head') }} strategy: fail-fast: false From 83a4f4f73fdec399743dceec58383d56d3f879c9 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Mon, 9 Oct 2023 16:03:09 -0700 Subject: [PATCH 02/10] Be less specific with Ruby versions, cleanup matrix excludes --- .github/workflows/test.yaml | 186 +++++++++++++++++------------------- 1 file changed, 88 insertions(+), 98 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7d12844..3300f35 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,14 +15,16 @@ jobs: fail-fast: false matrix: ruby: - - 2.1.9 - - 2.2.10 - - 2.3.8 - - 2.4.10 - - 2.5.9 - - 2.6.8 - - 2.7.4 - - 3.0.2 + - 2.1 + - 2.2 + - 2.3 + - 2.4 + - 2.5 + - 2.6 + - 2.7 + - 3.0 + - 3.1 + - 3.2 - truffleruby-head gemfile: - gemfiles/rails_3_0.gemfile @@ -39,137 +41,125 @@ jobs: - Gemfile - gemfiles/rails_head.gemfile exclude: - - ruby: 1.9.2 - gemfile: gemfiles/rails_4_0.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_4_1.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_4_2.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_5_0.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_5_1.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_5_2.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_6_0.gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_6_1.gemfile - - ruby: 1.9.2 - gemfile: Gemfile - - ruby: 1.9.2 - gemfile: gemfiles/rails_head.gemfile - - ruby: 1.9.3 - gemfile: gemfiles/rails_5_0.gemfile - - ruby: 1.9.3 - gemfile: gemfiles/rails_5_1.gemfile - - ruby: 1.9.3 - gemfile: gemfiles/rails_5_2.gemfile - - ruby: 1.9.3 - gemfile: gemfiles/rails_6_0.gemfile - - ruby: 1.9.3 - gemfile: gemfiles/rails_6_1.gemfile - - ruby: 1.9.3 - gemfile: Gemfile - - ruby: 1.9.3 - gemfile: gemfiles/rails_head.gemfile - - ruby: 2.0.0 - gemfile: gemfiles/rails_5_0.gemfile - - ruby: 2.0.0 - gemfile: gemfiles/rails_5_1.gemfile - - ruby: 2.0.0 - gemfile: gemfiles/rails_5_2.gemfile - - ruby: 2.0.0 - gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.0.0 - gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.0.0 - gemfile: Gemfile - - ruby: 2.0.0 - gemfile: gemfiles/rails_head.gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: gemfiles/rails_5_0.gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: gemfiles/rails_5_1.gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: gemfiles/rails_5_2.gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: Gemfile - - ruby: 2.1.9 + - ruby: 2.1 gemfile: gemfiles/rails_head.gemfile - - ruby: 2.2.10 + - ruby: 2.2 gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.2.10 + - ruby: 2.2 gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.2.10 + - ruby: 2.2 gemfile: Gemfile - - ruby: 2.2.10 + - ruby: 2.2 gemfile: gemfiles/rails_head.gemfile - - ruby: 2.3.8 + - ruby: 2.3 gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.3.8 + - ruby: 2.3 gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.3.8 + - ruby: 2.3 gemfile: Gemfile - - ruby: 2.3.8 + - ruby: 2.3 gemfile: gemfiles/rails_head.gemfile - - ruby: 2.4.10 + - ruby: 2.4 gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.4.10 + - ruby: 2.4 gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.4.10 + - ruby: 2.4 gemfile: Gemfile - - ruby: 2.4.10 + - ruby: 2.4 gemfile: gemfiles/rails_head.gemfile - - ruby: 2.5.9 + - ruby: 2.5 gemfile: gemfiles/rails_3_0.gemfile - - ruby: 2.5.9 + - ruby: 2.5 gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.5.9 + - ruby: 2.5 gemfile: Gemfile - - ruby: 2.5.9 + - ruby: 2.5 gemfile: gemfiles/rails_head.gemfile - - ruby: 2.6.8 + - ruby: 2.6 gemfile: gemfiles/rails_3_0.gemfile - - ruby: 2.6.8 + - ruby: 2.6 gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.6.8 + - ruby: 2.6 gemfile: Gemfile - - ruby: 2.6.8 + - ruby: 2.6 gemfile: gemfiles/rails_head.gemfile - - ruby: 2.7.4 + - ruby: 2.7 gemfile: gemfiles/rails_3_0.gemfile - - ruby: 2.7.4 + - ruby: 2.7 gemfile: gemfiles/rails_3_1.gemfile - - ruby: 2.7.4 + - ruby: 2.7 gemfile: gemfiles/rails_3_2.gemfile - - ruby: 2.7.4 + - ruby: 2.7 gemfile: gemfiles/rails_4_0.gemfile - - ruby: 2.7.4 + - ruby: 2.7 gemfile: gemfiles/rails_4_1.gemfile - - ruby: 2.7.4 + - ruby: 2.7 gemfile: gemfiles/rails_4_2.gemfile - - ruby: 3.0.2 + - ruby: 3.0 + gemfile: gemfiles/rails_3_0.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_3_1.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_3_2.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_4_0.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_4_1.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_4_2.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_5_0.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_5_1.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_5_2.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_3_0.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_3_1.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_3_2.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_4_0.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_4_1.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_4_2.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_5_0.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_5_1.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_5_2.gemfile + - ruby: 3.2 gemfile: gemfiles/rails_3_0.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_3_1.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_3_2.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_4_0.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_4_1.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_4_2.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_5_0.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_5_1.gemfile - - ruby: 3.0.2 + - ruby: 3.2 gemfile: gemfiles/rails_5_2.gemfile - ruby: truffleruby-head gemfile: gemfiles/rails_3_0.gemfile From ea1c63db054152c45f58a3705fb6b16f2bd07384 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Mon, 9 Oct 2023 20:00:41 -0700 Subject: [PATCH 03/10] Use strings for Ruby versions, fix Struct usage for Ruby 3.2 --- .github/workflows/test.yaml | 142 +++++++++++------------ spec/unit/active_attr/attributes_spec.rb | 2 +- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3300f35..f575a7d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,16 +15,16 @@ jobs: fail-fast: false matrix: ruby: - - 2.1 - - 2.2 - - 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - 3.0 - - 3.1 - - 3.2 + - "2.1" + - "2.2" + - "2.3" + - "2.4" + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - "3.1" + - "3.2" - truffleruby-head gemfile: - gemfiles/rails_3_0.gemfile @@ -41,125 +41,125 @@ jobs: - Gemfile - gemfiles/rails_head.gemfile exclude: - - ruby: 2.1 + - ruby: "2.1" gemfile: gemfiles/rails_5_0.gemfile - - ruby: 2.1 + - ruby: "2.1" gemfile: gemfiles/rails_5_1.gemfile - - ruby: 2.1 + - ruby: "2.1" gemfile: gemfiles/rails_5_2.gemfile - - ruby: 2.1 + - ruby: "2.1" gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.1 + - ruby: "2.1" gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.1 + - ruby: "2.1" gemfile: Gemfile - - ruby: 2.1 + - ruby: "2.1" gemfile: gemfiles/rails_head.gemfile - - ruby: 2.2 + - ruby: "2.2" gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.2 + - ruby: "2.2" gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.2 + - ruby: "2.2" gemfile: Gemfile - - ruby: 2.2 + - ruby: "2.2" gemfile: gemfiles/rails_head.gemfile - - ruby: 2.3 + - ruby: "2.3" gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.3 + - ruby: "2.3" gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.3 + - ruby: "2.3" gemfile: Gemfile - - ruby: 2.3 + - ruby: "2.3" gemfile: gemfiles/rails_head.gemfile - - ruby: 2.4 + - ruby: "2.4" gemfile: gemfiles/rails_6_0.gemfile - - ruby: 2.4 + - ruby: "2.4" gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.4 + - ruby: "2.4" gemfile: Gemfile - - ruby: 2.4 + - ruby: "2.4" gemfile: gemfiles/rails_head.gemfile - - ruby: 2.5 + - ruby: "2.5" gemfile: gemfiles/rails_3_0.gemfile - - ruby: 2.5 + - ruby: "2.5" gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.5 + - ruby: "2.5" gemfile: Gemfile - - ruby: 2.5 + - ruby: "2.5" gemfile: gemfiles/rails_head.gemfile - - ruby: 2.6 + - ruby: "2.6" gemfile: gemfiles/rails_3_0.gemfile - - ruby: 2.6 + - ruby: "2.6" gemfile: gemfiles/rails_6_1.gemfile - - ruby: 2.6 + - ruby: "2.6" gemfile: Gemfile - - ruby: 2.6 + - ruby: "2.6" gemfile: gemfiles/rails_head.gemfile - - ruby: 2.7 + - ruby: "2.7" gemfile: gemfiles/rails_3_0.gemfile - - ruby: 2.7 + - ruby: "2.7" gemfile: gemfiles/rails_3_1.gemfile - - ruby: 2.7 + - ruby: "2.7" gemfile: gemfiles/rails_3_2.gemfile - - ruby: 2.7 + - ruby: "2.7" gemfile: gemfiles/rails_4_0.gemfile - - ruby: 2.7 + - ruby: "2.7" gemfile: gemfiles/rails_4_1.gemfile - - ruby: 2.7 + - ruby: "2.7" gemfile: gemfiles/rails_4_2.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_3_0.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_3_1.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_3_2.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_4_0.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_4_1.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_4_2.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_5_0.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_5_1.gemfile - - ruby: 3.0 + - ruby: "3.0" gemfile: gemfiles/rails_5_2.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_3_0.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_3_1.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_3_2.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_4_0.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_4_1.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_4_2.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_5_0.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_5_1.gemfile - - ruby: 3.1 + - ruby: "3.1" gemfile: gemfiles/rails_5_2.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_3_0.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_3_1.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_3_2.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_4_0.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_4_1.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_4_2.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_5_0.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_5_1.gemfile - - ruby: 3.2 + - ruby: "3.2" gemfile: gemfiles/rails_5_2.gemfile - ruby: truffleruby-head gemfile: gemfiles/rails_3_0.gemfile @@ -185,7 +185,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Nokogiri support for TruffleRuby run: sudo apt-get -yqq install libxml2-dev libxslt-dev if: ${{ matrix.ruby == 'truffleruby-head' }} diff --git a/spec/unit/active_attr/attributes_spec.rb b/spec/unit/active_attr/attributes_spec.rb index 777910d..ba7ccf0 100644 --- a/spec/unit/active_attr/attributes_spec.rb +++ b/spec/unit/active_attr/attributes_spec.rb @@ -211,7 +211,7 @@ def self.name end it "returns false when compared to another type" do - should_not == Struct.new(:attributes).new("first_name" => "Ben") + should_not == Struct.new(:attributes).new({ "first_name" => "Ben" }) end end From f04404a2b1cb81bd98352e91b564823d83b9a87e Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Mon, 9 Oct 2023 20:09:57 -0700 Subject: [PATCH 04/10] Replace unsupported git:// protocol --- gemfiles/rails_head.gemfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/rails_head.gemfile b/gemfiles/rails_head.gemfile index fb1f632..e3e3b07 100644 --- a/gemfiles/rails_head.gemfile +++ b/gemfiles/rails_head.gemfile @@ -2,13 +2,13 @@ source "https://rubygems.org" gemspec :development_group => :test, :path => ".." -git "git://github.com/rails/rails.git", :branch => "main" do +git "git@github.com:rails/rails.git", :branch => "main" do gem "activemodel" gem "activesupport" gem "actionpack" end -gem "activemodel-serializers-xml", :group => :test, :git => "git://github.com/rails/activemodel-serializers-xml.git" +gem "activemodel-serializers-xml", :group => :test, :git => "git@github.com:rails/activemodel-serializers-xml.git" gem "rexml", :group => :test -gem "protected_attributes_continued", :group => :test, :git => "git://github.com/westonganger/protected_attributes_continued" -gem "rack", :group => :test, :git => "git://github.com/rack/rack.git" +gem "protected_attributes_continued", :group => :test, :git => "git@github.com:westonganger/protected_attributes_continued" +gem "rack", :group => :test, :git => "git@github.com:rack/rack.git" From 6c00a6d0cff0105b297b464cb7a55bfb7ce8f20d Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Tue, 10 Oct 2023 02:47:10 -0700 Subject: [PATCH 05/10] Update rails_head.gemfile --- gemfiles/rails_head.gemfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/rails_head.gemfile b/gemfiles/rails_head.gemfile index e3e3b07..8886d92 100644 --- a/gemfiles/rails_head.gemfile +++ b/gemfiles/rails_head.gemfile @@ -2,13 +2,13 @@ source "https://rubygems.org" gemspec :development_group => :test, :path => ".." -git "git@github.com:rails/rails.git", :branch => "main" do +git "https://github.com/rails/rails.git", :branch => "main" do gem "activemodel" gem "activesupport" gem "actionpack" end -gem "activemodel-serializers-xml", :group => :test, :git => "git@github.com:rails/activemodel-serializers-xml.git" +gem "activemodel-serializers-xml", :group => :test, :git => "https://github.com/rails/activemodel-serializers-xml.git" gem "rexml", :group => :test -gem "protected_attributes_continued", :group => :test, :git => "git@github.com:westonganger/protected_attributes_continued" -gem "rack", :group => :test, :git => "git@github.com:rack/rack.git" +gem "protected_attributes_continued", :group => :test, :git => "https://github.com/westonganger/protected_attributes_continued" +gem "rack", :group => :test, :git => "https://github.com/rack/rack.git" From 86ad0680c068bbc650541b25d7e1d12fff7a83a3 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Tue, 10 Oct 2023 08:31:17 -0700 Subject: [PATCH 06/10] Use main branch for rack --- gemfiles/rails_head.gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/rails_head.gemfile b/gemfiles/rails_head.gemfile index 8886d92..9557d36 100644 --- a/gemfiles/rails_head.gemfile +++ b/gemfiles/rails_head.gemfile @@ -10,5 +10,5 @@ end gem "activemodel-serializers-xml", :group => :test, :git => "https://github.com/rails/activemodel-serializers-xml.git" gem "rexml", :group => :test -gem "protected_attributes_continued", :group => :test, :git => "https://github.com/westonganger/protected_attributes_continued" -gem "rack", :group => :test, :git => "https://github.com/rack/rack.git" +gem "protected_attributes_continued", :group => :test, :git => "https://github.com/westonganger/protected_attributes_continued.git" +gem "rack", :group => :test, :git => "https://github.com/rack/rack.git", :branch => "main" From 8048d35b55de20b5d669151287f6d887e8232e13 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Tue, 10 Oct 2023 09:01:10 -0700 Subject: [PATCH 07/10] Add Rails 7.1 support --- .github/workflows/test.yaml | 13 +++++++++++++ CHANGELOG.md | 6 ++++++ active_attr.gemspec | 6 +++--- gemfiles/rails_7_0.gemfile | 10 ++++++++++ lib/active_attr/version.rb | 2 +- 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 gemfiles/rails_7_0.gemfile diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f575a7d..12adec8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -38,6 +38,7 @@ jobs: - gemfiles/rails_5_2.gemfile - gemfiles/rails_6_0.gemfile - gemfiles/rails_6_1.gemfile + - gemfiles/rails_7_0.gemfile - Gemfile - gemfiles/rails_head.gemfile exclude: @@ -51,6 +52,8 @@ jobs: gemfile: gemfiles/rails_6_0.gemfile - ruby: "2.1" gemfile: gemfiles/rails_6_1.gemfile + - ruby: "2.1" + gemfile: gemfiles/rails_7_0.gemfile - ruby: "2.1" gemfile: Gemfile - ruby: "2.1" @@ -59,6 +62,8 @@ jobs: gemfile: gemfiles/rails_6_0.gemfile - ruby: "2.2" gemfile: gemfiles/rails_6_1.gemfile + - ruby: "2.2" + gemfile: gemfiles/rails_7_0.gemfile - ruby: "2.2" gemfile: Gemfile - ruby: "2.2" @@ -67,6 +72,8 @@ jobs: gemfile: gemfiles/rails_6_0.gemfile - ruby: "2.3" gemfile: gemfiles/rails_6_1.gemfile + - ruby: "2.3" + gemfile: gemfiles/rails_7_0.gemfile - ruby: "2.3" gemfile: Gemfile - ruby: "2.3" @@ -75,6 +82,8 @@ jobs: gemfile: gemfiles/rails_6_0.gemfile - ruby: "2.4" gemfile: gemfiles/rails_6_1.gemfile + - ruby: "2.4" + gemfile: gemfiles/rails_7_0.gemfile - ruby: "2.4" gemfile: Gemfile - ruby: "2.4" @@ -83,6 +92,8 @@ jobs: gemfile: gemfiles/rails_3_0.gemfile - ruby: "2.5" gemfile: gemfiles/rails_6_1.gemfile + - ruby: "2.5" + gemfile: gemfiles/rails_7_0.gemfile - ruby: "2.5" gemfile: Gemfile - ruby: "2.5" @@ -91,6 +102,8 @@ jobs: gemfile: gemfiles/rails_3_0.gemfile - ruby: "2.6" gemfile: gemfiles/rails_6_1.gemfile + - ruby: "2.6" + gemfile: gemfiles/rails_7_0.gemfile - ruby: "2.6" gemfile: Gemfile - ruby: "2.6" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb4e18..5669c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# ActiveAttr 0.15.5 (October 10, 2023) + +* ActiveAttr now supports Ruby 3.1 +* ActiveAttr now supports Ruby 3.2 +* ActiveAttr now supports Rails 7.1 (thanks ) + # ActiveAttr 0.15.4 (December 16, 2021) * ActiveAttr now supports Rails 7.0 (Steve Hoeksema) diff --git a/active_attr.gemspec b/active_attr.gemspec index f90bbe1..4cc5fb9 100644 --- a/active_attr.gemspec +++ b/active_attr.gemspec @@ -22,9 +22,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.1.0" - gem.add_runtime_dependency "actionpack", ">= 3.0.2", "< 7.1" - gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 7.1" - gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 7.1" + gem.add_runtime_dependency "actionpack", ">= 3.0.2", "< 7.2" + gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 7.2" + gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 7.2" gem.add_development_dependency "bundler" gem.add_development_dependency "factory_bot", "< 5.0" diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile new file mode 100644 index 0000000..90c6bdb --- /dev/null +++ b/gemfiles/rails_7_0.gemfile @@ -0,0 +1,10 @@ +source "https://rubygems.org" + +gemspec :development_group => :test, :path => ".." + +gem "activemodel", "~> 7.0.0" +gem "activesupport", "~> 7.0.0" +gem "actionpack", "~> 7.0.0" +gem "activemodel-serializers-xml", :group => :test +gem "rexml", :group => :test +gem "protected_attributes_continued", :group => :test diff --git a/lib/active_attr/version.rb b/lib/active_attr/version.rb index 1b9772e..b98e590 100644 --- a/lib/active_attr/version.rb +++ b/lib/active_attr/version.rb @@ -1,5 +1,5 @@ module ActiveAttr # Complete version string # @since 0.1.0 - VERSION = "0.15.4" + VERSION = "0.15.5" end From 1999482fee7728d7aa16854cf25e93a1a3a388bd Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Tue, 10 Oct 2023 12:56:15 -0700 Subject: [PATCH 08/10] Gemfile should test against 7.1 --- Gemfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index c0d03f8..018b8d9 100644 --- a/Gemfile +++ b/Gemfile @@ -2,9 +2,9 @@ source "https://rubygems.org" gemspec :development_group => :test -gem "activemodel", "~> 7.0.0" -gem "activesupport", "~> 7.0.0" -gem "actionpack", "~> 7.0.0" +gem "activemodel", "~> 7.1.0" +gem "activesupport", "~> 7.1.0" +gem "actionpack", "~> 7.1.0" gem "activemodel-serializers-xml", :group => :test gem "rexml", :group => :test gem "protected_attributes_continued", :group => :test From d2287110fb08b1edd5e9f169c14824814cd80ba4 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Wed, 11 Oct 2023 20:12:05 -0700 Subject: [PATCH 09/10] Rails 7.1+ support --- CHANGELOG.md | 2 +- lib/active_attr/attributes.rb | 12 ++++++++++-- lib/active_attr/version.rb | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5669c81..7d34cae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# ActiveAttr 0.15.5 (October 10, 2023) +# ActiveAttr 0.16.0 (October 11, 2023) * ActiveAttr now supports Ruby 3.1 * ActiveAttr now supports Ruby 3.2 diff --git a/lib/active_attr/attributes.rb b/lib/active_attr/attributes.rb index d385690..f1552f7 100644 --- a/lib/active_attr/attributes.rb +++ b/lib/active_attr/attributes.rb @@ -66,7 +66,7 @@ def self.filter_attributes=(new_filter_attributes) class_attribute :filter_attributes, :instance_writer => false self.filter_attributes = Attributes.filter_attributes - attribute_method_suffix "" if attribute_method_matchers.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" } + attribute_method_suffix "" if attribute_method_patterns.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" } attribute_method_suffix "=" end @@ -323,6 +323,14 @@ def inspect "#{name}#{attributes_list}" end + # Renamed in ActiveModel 7.1 + # + # @private + # @since 0.16.0 + def attribute_method_patterns + attribute_method_matchers + end unless method_defined?(:attribute_method_patterns) + protected # Assign a set of attribute definitions, used when subclassing models @@ -346,7 +354,7 @@ def instance_method_already_implemented?(method_name) # # @since 0.6.0 def attribute_methods(name) - attribute_method_matchers.map { |matcher| matcher.method_name name } + attribute_method_patterns.map { |matcher| matcher.method_name name } end # Ruby inherited hook to assign superclass attributes to subclasses diff --git a/lib/active_attr/version.rb b/lib/active_attr/version.rb index b98e590..24edf89 100644 --- a/lib/active_attr/version.rb +++ b/lib/active_attr/version.rb @@ -1,5 +1,5 @@ module ActiveAttr # Complete version string # @since 0.1.0 - VERSION = "0.15.5" + VERSION = "0.16.0" end From 8bd5a14ebdf9febb5e066f26c8a0e4016c6d1285 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Mon, 30 Oct 2023 13:47:20 -0700 Subject: [PATCH 10/10] Amend CHANGELOG --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d34cae..afde742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ -# ActiveAttr 0.16.0 (October 11, 2023) +# ActiveAttr 0.16.0 (October 30, 2023) * ActiveAttr now supports Ruby 3.1 * ActiveAttr now supports Ruby 3.2 -* ActiveAttr now supports Rails 7.1 (thanks ) +* ActiveAttr now supports Rails 7.1 (thanks @mathieujobin) # ActiveAttr 0.15.4 (December 16, 2021)