Skip to content

Fix for Rails 8.0.0 #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix for Rails 8.0.0 #135

wants to merge 1 commit into from

Conversation

tomukas
Copy link

@tomukas tomukas commented Nov 13, 2024

Original code doesnt work well with Rails 8.0.0

For example:
in ruby console: User.all.to_json(only: [:id, :name])
Returns error can't modify frozen Hash: {:only=>[:id, :name]} (FrozenError)

This PR will fix it.

@scpike
Copy link

scpike commented Jul 16, 2025

I can confirm this patch is necessary for Rails 8 compatibility. The underlying change is here: rails/rails#52826 (review).

This seems like a fine solution, it's similar to what active_model_serializers did at https://github.com/rails-api/active_model_serializers/pull/2482/files

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