Skip to content

Fix serialize type deprecation warning on Rails 7.1+#113

Merged
ledermann merged 5 commits intoledermann:masterfrom
mikker:rails-7-1
Sep 22, 2023
Merged

Fix serialize type deprecation warning on Rails 7.1+#113
ledermann merged 5 commits intoledermann:masterfrom
mikker:rails-7-1

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
@ledermann
Copy link
Owner

Great, thanks!

@mikker
Copy link
Contributor Author

mikker commented Sep 22, 2023

Thank you for the quick response 🤝

lluis pushed a commit to visrez/rails-settings that referenced this pull request Jul 16, 2025
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