Skip to content
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

Fix serialize type deprecation warning on Rails 7.1+ #113

Merged
merged 5 commits into from
Sep 22, 2023
Merged

Fix serialize type deprecation warning on Rails 7.1+ #113

merged 5 commits into from
Sep 22, 2023

Conversation

mikker
Copy link
Contributor

@mikker mikker commented Sep 20, 2023

Upgrading to Rails 7.1 is giving me this warning when my app boots:

DEPRECATION WARNING: Passing the class as positional argument is deprecated and will be removed in Rails 7.2.

Please pass the class as a keyword argument:

  serialize :value, type: Hash

This fixes it.

@mikker
Copy link
Contributor Author

mikker commented Sep 21, 2023

Not sure what the best version number to compare against is but currently 7.1.0.beta1 is the most recent one.

if ActiveRecord.version >= "7.1.0.beta1"

On final release, maybe we could change it to just "7.1.0" which reads a bit better IMO. Not sure.

Copy link
Owner

@ledermann ledermann left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM. One minor thing: Can you remove the unrelated formatting changes, please?

@mikker
Copy link
Contributor Author

mikker commented Sep 22, 2023

Of course! Forgot to turn off Rubyfmt in that last commit 🙄

@ledermann ledermann merged commit 1f5d1da into ledermann:master Sep 22, 2023
17 checks passed
@ledermann
Copy link
Owner

Great, thanks!

@mikker
Copy link
Contributor Author

mikker commented Sep 22, 2023

Thank you for the quick response 🤝

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.

None yet

2 participants