-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Weird params behavior #1828
Comments
some more info in #1592 |
Okay I see now. I'm still confused as to why def transform_keys(&block)
dup.transform_keys!(&block)
end
def transform_keys!
super
super(&method(:convert_key))
end |
|
ah gotcha okay thanks for clearing that up. |
Looking at the timing you brought this up, did your code include a I was wondering the same (some code broke after an upgrade) and it turns out that these methods did return regular hashes before the upgrade (and thus |
I don't recall using |
Exactly
Nolan Mayersky ***@***.***> schrieb am Di., 22. Nov. 2022,
18:53:
… Looking at the timing you brought this up, did your code include a select
or reject call before using transform_keys in the past?
I don't recall using select or reject previously. So, if you used one of
those before it returned a regular ruby hash?
—
Reply to this email directly, view it on GitHub
<#1828 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADOXUDHGNEB6SJHDSV7ROLWJUCC3ANCNFSM6AAAAAARJTUMRU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I was trying to modify the params I was receiving and I was struggling to convert the keys to symbols. I eventually had to settle on
params.to_h.transform_keys(&:to_sym)
to get it to work. Now, I could've sworn I've never had to do this in the past, so potentially I screwed something up, I just have no idea what. If it isn't an error on my end though, here's some of my output:The text was updated successfully, but these errors were encountered: