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

legacy param behavior breaks router #191

Closed
catmando opened this issue May 19, 2019 · 0 comments
Closed

legacy param behavior breaks router #191

catmando opened this issue May 19, 2019 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@catmando
Copy link
Contributor

Router helpers are breaking if param_accessor_style is legacy.

Problem is router uses params, and param_accessor_style is determined by the application, so the Router needs a consistent way to reference params.

Solution is for the Router to use the alias: feature, to create a instance variable accessor to params.

For example the location router param is aliased to _location_param and the router counts on @_location_param to be initialized regardless of the param_accessor_style.

But currently alias: is being applied to legacy param.xxx style accessors, which then breaks the application code. For example application code historically can use either the location helper method or params.location to get the location value. But if we apply alias to legacy param names then it becomes params._location_param.

So the solution is to NOT honor alias for the legacy param name (only for the instance variable name, and the direct accessor method name.)

Related though is that in the PropsWrapper initializer we don't initialize instance variables if accessor_style is :legacy.

@catmando catmando added the bug Something isn't working label May 19, 2019
@catmando catmando added this to the alpha1.5 milestone May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant