-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
Array version of allow_value
#562
Comments
You can say that already: # will assert that both "foo" and "bar" are valid values for :attr
allow_value("foo", "bar").for(:attr) The only case where this breaks down is in the |
@mcmire hum, that's cool but not intuitive. I thought |
@douglascamata It is possible but it would break backward compatibility, so we plan on doing that in 3.0. As for |
@mcmire I'll happy implement that as soon as I get home 👍 |
Closed by #692 -- the alias is now in master. |
Sometimes you need to see if some values are allowed for a defined field and using the current features you would have to use many
allow_value().for()
constructs. It would be nice to have a array version, likeallow_values('foo', 'bar').for()
.The text was updated successfully, but these errors were encountered: