We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a way to only allow certain values of a nested parameter? For example {:event => {:sub_events => [only allow certain sub events?]}}
The text was updated successfully, but these errors were encountered:
what would be the desired result of the following code?
hash = { event: { sub_events: ['only allow certain sub-events'] } } hash.allow(event: { sub_events: ['something else'] })
is it { event: {} } or { event: nil } or {} or something else?
{ event: {} }
{ event: nil }
{}
Sorry, something went wrong.
I would say {} so that if the allowed values are not met the entire hash is not accepted.
in that example the current code already does return {}. but what about the following?
hash = { event: { sub_events: ['only allow certain sub-events'] } } hash.allow(event: { pre_events: ['only allow certain pre-events'] })
No branches or pull requests
Is there a way to only allow certain values of a nested parameter? For example {:event => {:sub_events => [only allow certain sub events?]}}
The text was updated successfully, but these errors were encountered: