Repository navigation
Add klass method to serializers for Rails 8.1 compatibility - #37
Merged
grantspeelman merged 2 commits intoDec 19, 2025
Merged
Conversation
Rails 8.1 changed how ActiveJob::Serializers::ObjectSerializer works and now requires a klass method to be defined. - Add klass method to HttpUrlSerializer - Add klass method to EmailAddressSerializer - Add klass method to PublicDomainSuffixSerializer - Update serialize? to use klass method - Bump version to 2.0.5 - Add CHANGELOG.md Co-Authored-By: Grant <grantspeelman@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Convert local variable to let block to fix pre-existing rubocop issue. Co-Authored-By: Grant <grantspeelman@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates ActiveJob serializers to be compatible with Rails 8.1 by adding the required klass method to each serializer. Rails 8.1 changed ActiveJob::Serializers::ObjectSerializer to require this method.
Key Changes:
- Added
klassmethod to three ActiveJob serializers (HttpUrlSerializer,EmailAddressSerializer,PublicDomainSuffixSerializer) - Updated
serialize?methods to useklassinstead of hardcoded class names - Version bump to 2.0.5 with corresponding CHANGELOG entry
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/rails_values/http_url_serializer.rb | Added klass method returning HttpUrl and updated serialize? to use it |
| lib/rails_values/email_address_serializer.rb | Added klass method returning EmailAddress and updated serialize? to use it |
| lib/rails_values/public_domain_suffix_serializer.rb | Added klass method returning PublicDomainSuffix and updated serialize? to use it |
| rails_values.gemspec | Bumped version from 2.0.4 to 2.0.5 |
| CHANGELOG.md | Added entry documenting Rails 8.1 compatibility changes |
| spec/rails_values/currency_casting_spec.rb | Refactored test to use let instead of bare variable assignment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
grantspeelman
enabled auto-merge (squash)
December 19, 2025 12:49
grantspeelman
approved these changes
Dec 19, 2025
grantspeelman
deleted the
devin/1766147404-rails-8.1-serializer-klass-method
branch
December 19, 2025 12:49
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.
Rails 8.1 changed how
ActiveJob::Serializers::ObjectSerializerworks and now requires aklassmethod to be defined. This PR adds theklassmethod to the three ActiveJob serializers in this gem:HttpUrlSerializerEmailAddressSerializerPublicDomainSuffixSerializerEach serializer now defines
klassreturning the appropriate class, andserialize?has been updated to useklassinstead of hardcoding the class name.Also includes:
Requested by: Grant (grant@nexl.io)
Link to Devin run: https://app.devin.ai/sessions/9540f3cfa1354a8186b4c78238d3aff0