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

Check if type: array values are in enum #784

Conversation

movermeyer
Copy link
Contributor

🌈

What are you trying to accomplish?

Fixes #783

What approach did you choose and why?

Extending the pattern done for type: string and type: numeric.

What should reviewers focus on?

🤷

The impact of these changes

enum validation will be done for type: array option values.

array << shift while current_is_value?
while current_is_value?
value = shift
if !value.empty? && @switches.is_a?(Hash) && switch = @switches[name]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we restructure this conditional a bit? The = towards the end is kind of like a shark in calm waters, it's really unexpected.

@rafaelfranca rafaelfranca merged commit 98ebfd2 into rails:main May 12, 2023
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.

enum should be enforced for all values of type: array
3 participants