filterrific icon indicating copy to clipboard operation
filterrific copied to clipboard

Fix nested array attributes

Open phylor opened this issue 2 years ago • 1 comments

This PR fixes nested array attributes. It seems to be a duplicate of #116 and/or #178. @jhund It would be great if one of these solutions could be merged!

Suppose one sends the following parameters as a filter:

filter_nested_params: {
  an_array: %w[one two three],
  a_string: "one"
}

This currently only permits a_string, because an_array would need to be permitted using an_array: [].

The following works fine though (it's only a problem when nested):

filter_array_string: %w[one two three]

I would suggest to change the existing code to permit all available filters, independent of how deep they are nested.

phylor avatar Jul 08 '22 21:07 phylor

Oops, I seem to have fixed the same issue you're solving here on #226, and I like your approach better

neilvcarvalho avatar Sep 04 '23 16:09 neilvcarvalho