Add Rails 8.1 compatibility tests for relationship routes (Issue #1479)#22
Merged
takaokouji merged 1 commit intomasterfrom Jan 21, 2026
Merged
Conversation
Tests to verify Issue JSONAPI-Resources#1479 is fixed: - Rails 8.1 changed ActionDispatch::Routing::Mapper::Resources::Resource#initialize to require keyword arguments - These tests verify that jsonapi_resources generates relationship routes correctly - Tests include has_many and polymorphic belongs_to relationships - Confirms automatic jsonapi_relationships call works in Rails 8.1+ All 37 route tests pass on Rails 8.1.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds explicit tests to verify that Issue JSONAPI-Resources#1479 (Rails 8.1 relationship routes not generated) is fixed in the current master branch.
Issue JSONAPI-Resources#1479
ActionDispatch::Routing::Mapper::Resources::Resource#initializeto require keyword argumentsjsonapi_relationshipswas not automatically called, causing relationship routes to be missingChanges
test_routing_articles_show- Basic resource routetest_routing_articles_relationship_comments_show- has_many relationship show routetest_routing_articles_relationship_comments_create- has_many relationship create routetest_routing_articles_relationship_comments_update- has_many relationship update routetest_routing_articles_relationship_comments_destroy- has_many relationship delete routetest_routing_article_comments_relationship_commentable_show- Polymorphic belongs_to relationship routeTest Results
All tests pass on Rails 8.1.2:
Related