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

Fixes #123 - Avoid Unpermitted parameters on Playlists::SongsController #146

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

jaredmoody
Copy link
Contributor

Calling permit on the base params makes other params that are submitted invalid - and there are others, such as playlist_id and authenticity_token.

Because no params are being mass-assigned, there's no benefit to calling permit anyway, so remove playlist_songs_params

Added a config to dev and test to raise when unpermitted params are passed to surface errors like this.

…:SongsController

Calling `permit` on the base params makes other params that are submitted invalid - and there are others, such as playlist_id and authenticity_token.

Because no params are being mass-assigned, there's no benefit to calling `permit` anyway, so remove `playlist_songs_params`

Added a config to dev and test to raise when unpermitted params are passed to surface errors like this.
@coveralls
Copy link

coveralls commented Mar 4, 2022

Pull Request Test Coverage Report for Build 1932495450

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.009%) to 96.923%

Totals Coverage Status
Change from base Build 1919682472: -0.009%
Covered Lines: 693
Relevant Lines: 715

💛 - Coveralls

@jaredmoody
Copy link
Contributor Author

I thought this was the source of #123, but I think I was wrong - I just deployed it to my local install and the issue persists.

However, I think the patch is still worthwhile as it prevents unpermitted parameter errors, and causes future unpermitted parameters to be found in the development/test environments.

@aidewoode aidewoode merged commit be121c3 into blackcandy-org:master Mar 4, 2022
@jaredmoody jaredmoody deleted the add-to-playlist-#123 branch May 30, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants