Skip to content

Rails 7.0 to 8.1 and Ruby 3.4 support for release-0-9 - #1501

Open
MichalBryxi wants to merge 5 commits into
JSONAPI-Resources:release-0-9from
MichalBryxi:rails-8-release-0-9
Open

MichalBryxi wants to merge 5 commits into
JSONAPI-Resources:release-0-9from
MichalBryxi:rails-8-release-0-9

Conversation

@MichalBryxi

Copy link
Copy Markdown

Makes the 0.9 line run, and its own suite pass, on Rails 7.0 through 8.1 and Ruby 3.2 and 3.4, without dropping any Rails or Ruby the CI tests today.

release-0-9 already has the Rack 3 fix (#1462) and the Rails 8.1 routing backport (#1497), so routing and status codes already worked. What remained:

Library

  • ActiveSupport::Deprecation.warn was removed in Rails 7.2, so attribute :id and belongs_to raised NoMethodError. They now warn through JSONAPI.deprecator, an ActiveSupport::Deprecation instance.
  • csv is a bundled gem from Ruby 3.4, so it's a dependency now.
  • Validation errors use 422 rather than :unprocessable_entity, which Rack 3.1 renamed and warns about, while older Racks don't know the new name.

Tests

  • The test app is initialized before rails/test_help. From Rails 7.1, rails/test_help reads the application's config while it loads.
  • Other test changes: schema_format :none (gone in Rails 8.0), fixture_paths= (7.1+), keyword args forwarded explicitly (Ruby 3), and an invalid t.references ... references: option.
  • minitest is pinned to 5, and sqlite3 to >= 2.1 on Rails 8.
  • The invalid-JSON test now also accepts json 2.10's error wording.

CI: an explicit matrix of 18 jobs, from Rails 5.1 on Ruby 2.6 to Rails 8.1 on Ruby 3.4. It runs on ubuntu-22.04, which still has Ruby 2.6 and 2.7 builds.

Verified locally (official ruby:* Docker images)

All 626 tests pass (7561 assertions) on each of:

Ruby Rails
2.6 5.2.8.1, 6.1.7.10
2.7 5.1.7, 5.2.8.1, 6.0.6.1, 6.1.7.10, 7.0.10
3.2 6.1.7.10, 7.0.10, 8.1.4.1
3.4 7.0.10, 7.1.6, 7.2.4, 8.0.5.2, 8.1.4.1

Fixes #1477 for the 0.9 line. Related: #1479 and #1488 (Rails 8.1 routing, fixed by #1497), #1480 (Rails 7.1+/8 support for master). A 0.9.13 release from this branch would unblock apps pinned to 0.9 through jsonapi-authorization (~> 0.9.0).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QduxfgWotKixa3ehszsbf2

MichalBryxi and others added 5 commits November 13, 2026 12:02
The request parser and resources use CSV, which Ruby 3.4 no longer loads
without it being in the bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QduxfgWotKixa3ehszsbf2
Rails 7.2 removed ActiveSupport::Deprecation.warn, so declaring an id
attribute or a belongs_to raised NoMethodError. An ActiveSupport::Deprecation
instance works on every Rails the gem supports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QduxfgWotKixa3ehszsbf2
- Initialize the test app before rails/test_help, which reads the
  application's config while loading from Rails 7.1.
- schema_format :none is gone from Rails 8.0; no schema is dumped instead.
- represent_boolean_as_integer only exists on Rails 5.2.
- fixture_path= became fixture_paths= (7.1) and was removed (7.2).
- Forward keyword arguments to process/get explicitly (Ruby 3).
- t.references never took a references: option; Rails 7.1 rejects it.
- Pin minitest to 5: minitest 6 moved minitest/mock out.
- Rails 8 needs sqlite3 >= 2.1.
- Accept the json gem's newer parse error wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QduxfgWotKixa3ehszsbf2
Keeps Rails 5.1 to 6.1 on Ruby 2.6 and 2.7, and runs on ubuntu-22.04,
which setup-ruby still has Ruby 2.6 and 2.7 for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QduxfgWotKixa3ehszsbf2
Rack 3.1 renamed :unprocessable_entity to :unprocessable_content and warns
on the old name, which older Racks don't know. The number works on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QduxfgWotKixa3ehszsbf2

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant