-
Notifications
You must be signed in to change notification settings - Fork 196
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
How to use Volt::Boolean? #341
Comments
Hello @myknbani Thanks for opening this issue, I do not know the answer to your question and it is not extremely clear to me either. I saw the only example I could find of it here (https://github.com/voltrb/docs/blob/7a496e81ed547407fb57ef62eedf0c655afa27f5/en/docs/models.md#fields) which does not show it being populated via seeding. If someone could chime in here on this it would be much appreciated. Here are some points of interest in the code regarding Volt::Boolean..
@myknbani Would you mind putting up on github an example project that reproduces this issue so that it can be easily investigated further? I am sure that would help other people interested in determining what they need to do to implement the desired behavior. |
@afaur Thanks for chiming in. I think it's because of
A quick tinkering with the Volt console shows this issue:
|
I have the following field definitions in my User class:
field :admin, Volt::Boolean
And for my user_seeds.rb file I have
When I run it produces:
The following seems to do what I want:
field :admin, [TrueClass, FalseClass]
The text was updated successfully, but these errors were encountered: