Comments (2)
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.
from volt.
@afaur Thanks for chiming in.
I think it's because of
if value.is_a?(type_rest)
true.is_a?(Volt::Boolean)
is false.
A quick tinkering with the Volt console shows this issue:
[2] volt(main)> class Foo < Volt::Model
[2] volt(main)* field :cute, Volt::Boolean
[2] volt(main)* end
=> :cute=
[3] volt(main)> f = store._foos.buffer(cute: true)
=> #<Foo id: "5885..657b", cute: true>
[4] volt(main)> f.validate!
=> #<Promise(47396377599140): #<Volt::Errors {:cute=>["must be true or false"]}>>
[5] volt(main)> class Bar < Volt::Model
[5] volt(main)* field :evil, [TrueClass, FalseClass]
[5] volt(main)* end
=> :evil=
[6] volt(main)> b = store._bars.buffer(evil: false)
=> #<Bar id: "f6d5..5c94", evil: false>
[7] volt(main)> b.validate!
=> #<Promise(47396380736960): #<Volt::Errors {}>>
from volt.
Related Issues (20)
- Deployment with docker impossible, missing node.js HOT 3
- `config.try` doesn't work in the server? HOT 4
- Following todos tutorial update does not work HOT 4
- DDP HOT 2
- Volt, Crawlers and SEO HOT 1
- Disable persistence layer (volt-mongo) on Volt HOT 2
- Volt Future related questions HOT 1
- Server won't start - broken dependency on listen / rb-inotifier gems HOT 1
- Server process doesn't actually stop
- I18n HOT 1
- Has this project been abandoned? HOT 18
- Volt Status HOT 1
- docs at voltframework.com/docs are only visible through a workaround
- Fork Volt HOT 6
- This project is dead? HOT 2
- Is this project definitely dead? HOT 1
- Reborn Volt
- "Connection lost..." smoth offline data and resync
- Link to Opal needs to be switched from .org to .com
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volt.