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 serializing Parameters as yaml #44749

Merged
merged 1 commit into from Mar 23, 2022

Conversation

skipkayhil
Copy link
Member

Summary

This has been broken since the logging context was added in
6be9c49

Also added a higher level test to ensure that this isn't broken again in
the future.

Other Information

The test isn't perfect, as the anonymous class causing the error doesn't seem to exist in the test case. (It's somewhere around ActionDispatch::Routing::RouteSet::NamedRouteCollection based on printing @emitter.instance_variable_get(:@stack) in a debugger). So instead of testing that to_yaml doesn't error, I tested the actual output, which I think is also reasonable (since the logging context should not be in the output)

Fixes #44743

This has been broken since the logging context was added in
6be9c49

Also added a higher level test to ensure that this isn't broken again in
the future.
@tenderlove tenderlove merged commit d02cdf2 into rails:main Mar 23, 2022
@skipkayhil skipkayhil deleted the fix-params-to-yaml branch March 23, 2022 15:50
skipkayhil pushed a commit to skipkayhil/rails that referenced this pull request Mar 23, 2022
rafaelfranca added a commit that referenced this pull request Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

params.to_yaml fails with TypeError (can't dump anonymous module ) in Rails 7
2 participants