cancan_strong_parameters
cancan_strong_parameters copied to clipboard
Failing test when only an Array param present
I ran into an issue today while using permit_params
like this:
permit_params label_ids: Array
We only needed to permit an array param. We're running version 0.3 and an ActiveModel::ForbiddenAttributes
exception is thrown. I wrote a failing test for this (although I don't know if you'd want to include this - the naming is a bit poor here).
This isn't a huge issue for us, but I thought I'd share. We're using a workaround like this instead:
permit_params(
:placeholder,
label_ids: Array
)
Just let me know if a full pull request would be helpful. This might not be worth it as it might be an edge case for most people.