Y25-318 Publish sanger-jsonapi-resources gem from master#4
Merged
Y25-318 Publish sanger-jsonapi-resources gem from master#4
Conversation
…resource generators
…onsistent require statements
…version change to 0.2.0
stevieing
requested changes
Jun 18, 2025
stevieing
left a comment
There was a problem hiding this comment.
I don't understand most of it so as long as it works I'm good.
1 issue to resolve with ruby versions.
| - '3.0' | ||
| - 3.1 | ||
| - 3.2 | ||
| - '3.3' |
There was a problem hiding this comment.
Traction Service is on ruby 3.4.4 so maybe worth adding ruby 3.4?
Author
Thanks for the review. Most of the changes are just to make things work with the current Rails and Ruby versions—updating the schema (ActiveRecord), tweaking the test_helper, and changing method which is no longer supported in Rails 8 (ActiveSupport::Deprecation.warn) |
stevieing
approved these changes
Jun 30, 2025
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.
Closes sanger/General-Backlog-Items#569
All Submissions:
This pull request creates a gem of version (0.2.0) from sanger-jsonapi-resources master branch (https://github.com/sanger/jsonapi-resources) ensuring compatibility with Rails version 7 and 8 and Ruby versions (3.3 and 3.2).
This pull request includes several updates to improve compatibility with newer Rails versions, simplify the codebase, and enhance testing and database configurations. The most notable changes involve introducing a compatibility helper for deprecation warnings, updating database configurations, and refining test setups. Below is a categorized summary of the most important changes:
Compatibility Enhancements:
Added
JSONAPI::CompatibilityHelpermodule to provide a version-safe method for issuing deprecation warnings across Rails versions. Updated all deprecation warnings inlib/jsonapifiles to use this helper instead ofActiveSupport::Deprecation.warn.Database Configuration Updates:
Updated
test/fixtures/active_record.rbto replacelengthwithlimitfor string columnsRef: (https://guides.rubyonrails.org/active_record_migrations.html#column-modifiers)
Added explicit
foreign_keydefinitions for references to improve database schema compatibility.Split
t.referencescalls into separate lines for clarity and added explicit indexing for composite keys.CI Workflow Updates:
.github/workflows/ruby.ymland updating Ruby and Rails version matrices to focus on newer versions.Test Setup Refinements:
test/test_helper.rbto silence deprecation warnings conditionally based on Rails version and updated fixture paths for compatibility.Codebase Simplifications:
Added
require 'rails/generators'tolib/generators/jsonapi/controller_generator.rbandlib/generators/jsonapi/resource_generator.rbfor better clarity and dependency management.Added a conditional check to skip processing in
find_related_polymorphic_fragmentsifrelation_positionisnil.