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

Fix nested array attributes #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phylor
Copy link

@phylor phylor commented Jul 8, 2022

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.

@neilvcarvalho
Copy link

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

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.

2 participants