cancan_strong_parameters icon indicating copy to clipboard operation
cancan_strong_parameters copied to clipboard

Failing test when only an Array param present

Open djhopper01 opened this issue 11 years ago • 0 comments

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.

djhopper01 avatar Nov 18 '13 22:11 djhopper01