-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Prefer JSON's symbolize_names option instead of ActiveSupport's deep_symbolize_keys
#372
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
Conversation
...ep_symbolize_keys` ref: rubocop/rubocop-rails#1534
symbolize_names option instead of ActiveSupport's dep_symbolize_keys (削除ここまで)symbolize_names option instead of ActiveSupport's deep_symbolize_keys (追記ここまで)
If it’s such a problem, I wonder if AS can somehow mark a freshly parsed object, and issue a warning if deep symbolise is called on it?
Cc @byroot
byroot
commented
Oct 11, 2025
If it’s such a problem
It's wasteful, but not necessarily a problem.
I wonder if AS can somehow mark a freshly parsed object
Nah, would mean monkey patching JSON, to then add an instance variable on a Hash object, that's too wasteful and dirty.
So does it make sense to implement this rule as a cop?
As a cop - certainly yes. As a guideline - I’m uncertain if it’s worth it.
ref: rubocop/rubocop-rails#1534