change how to set params type to new token in set_package #15489
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey Friends (yikes! like the CONTRIBUTING.md :) )
actually fixed this one #15403;
What's wrong with the old code?
Using the method
Token.token_type, the class itself changes and theform_with(@token)use the new form class to name the params, so therequire(:token)will throw an error.But the problems is not always available. You need to make a wrong search on project name or package name.
So setting the type with the
write_attribute(:type)and removing thetoken_typeallow to set the :type back and render correctly the :new partial.The fix correlated regards the default value for the
:typein theradio_buttons, was hard typed withservice.