-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Failing test to expose a declared params bug #1564
Failing test to expose a declared params bug #1564
Conversation
I'll be diving in to try and figure out whats wrong, but if this is expected behavior or someone has some hints about a fix, please let me know. |
3471b8b
to
dc43f81
Compare
Well, I got the tests to pass, BUT I doubt the way I fixed it is the right approach. The problem is I don't really understand the difference between The fix was: # Declared params including parent namespaces
all_declared_params = route_setting(:saved_declared_params).flatten | Array(route_setting(:declared_params))
# Declared params at current namespace
current_namespace_declared_params = route_setting(:saved_declared_params).last & Array(route_setting(:declared_params)) |
14 similar comments
de0ec0d
to
44d4c35
Compare
6 similar comments
5 similar comments
Same issue as #1544 looks like. |
I think this is fine, I'm going to merge it. The saved declared params are just whatever was there at endpoint construction, see this. |
I'm working on enforcing declared params usage in my codebase, and in doing so I started running into issues where I thought a declared param should be available via a parent scope, but for some reason wasn't.
This is one of those cases. It works as expected if I remove the route defined just above the namespace 'foo'.