Skip to content

Add klass method to serializers for Rails 8.1 compatibility - #37

Merged
grantspeelman merged 2 commits into
mainfrom
devin/1766147404-rails-8.1-serializer-klass-method
Dec 19, 2025
Merged

grantspeelman merged 2 commits into
mainfrom
devin/1766147404-rails-8.1-serializer-klass-method

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

Rails 8.1 changed how ActiveJob::Serializers::ObjectSerializer works and now requires a klass method to be defined. This PR adds the klass method to the three ActiveJob serializers in this gem:

  • HttpUrlSerializer
  • EmailAddressSerializer
  • PublicDomainSuffixSerializer

Each serializer now defines klass returning the appropriate class, and serialize? has been updated to use klass instead of hardcoding the class name.

Also includes:

  • Version bump from 2.0.4 to 2.0.5
  • New CHANGELOG.md documenting this change

Requested by: Grant (grant@nexl.io)
Link to Devin run: https://app.devin.ai/sessions/9540f3cfa1354a8186b4c78238d3aff0

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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Convert local variable to let block to fix pre-existing rubocop issue.

Co-Authored-By: Grant <grantspeelman@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 klass method to three ActiveJob serializers (HttpUrlSerializer, EmailAddressSerializer, PublicDomainSuffixSerializer)
  • Updated serialize? methods to use klass instead 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
grantspeelman enabled auto-merge (squash) December 19, 2025 12:49
@grantspeelman
grantspeelman merged commit ff85f8d into main Dec 19, 2025
7 checks passed
@grantspeelman
grantspeelman deleted the devin/1766147404-rails-8.1-serializer-klass-method branch December 19, 2025 12:49
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.

2 participants