Closed m7vicente closed 3 years ago
Merging #31 (6103c80) into master (b982ab1) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #31 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 109 101 -8
=========================================
- Hits 109 101 -8
Impacted Files | Coverage Δ | |
---|---|---|
src/field.js | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b982ab1...6103c80. Read the comment docs.
I dont know if thats the right solution to the problem. The word 'presence' refers to the existence of a property, in my point of view.
Whats your thoughts about creating another validation option like 'canBeEmpty' or 'emptyOrZero'?
It makes sense to me. But there could be other ways to validate that, perhaps with suma
I think something like @thgpdr-vortx propose make sense, but I also don't see any problem in this implementation
Not sure if this is what @thgpdr-vortx is proposing but we already have allowNull
:
Presence vs allowNull : https://github.com/herbsjs/suma#presence-vs-allownull
@dalssoft thats what I had in mind. I'd forgot about allowNull and also got it wrong at first the change proposed by @m7vicente
I dont see any problems now
If this is the way to go I think Boolean
and Array
should have the same behavior, right?
For those primitive types I agree, but, why not for the baseEntity
types? has a specific reason for instancing?
@m7vicente including baseEntity
as well.
Looking the modified tests it seems that the a fundamental behavior is changing. Do you have the same feeling? @m7vicente @jhomarolo @BritoDoug @thgpdr-vortx
Looking the modified tests it seems that the a fundamental behavior is changing. Do you have the same feeling? @m7vicente @jhomarolo @BritoDoug @thgpdr-vortx
Not exactly, the tests where I had feel that, have the description changed too. The point is, we need some tests to the old behavior ? I believe not
undefined X null
the argument about reserve null to who implements the library convinces me
@dalssoft , @m7vicente I do not see a fundamental change in functioning, but a change in concepts used, that we should avoid.
For me, null or undefined in this case is conceptual, but by concept, IMHO we should stick to the undefined and not the null.
great, so it seems we agreed to use undefined
.
next step: who could test this PR in a real system and analyze the impact?
The change seans to won't make any impact, I have made some tests in Vórtx internal applications, seans to be fine.
But on to-do-list
, and herb2knex
, some tests as broken.
The change seans to won't make any impact, I have made some tests in Vórtx internal applications, seans to be fine.
But on
to-do-list
, andherb2knex
, some tests as broken.
@m7vicente Can you print the error here?
to do list
herbs2knex
@m7vicente I believe that the mistakes there make sense, as they validate exactly what we are changing.
So far, so far so good for me, we just need to change these repositories as well.
same as @jhomarolo. it looks good to go!
great job @m7vicente!!!
:tada: This PR is included in version 1.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Fixed errors in validation appointed on issue #28
Before, number and string fields as initialized by
0
and''
, so, when suma try's validate 0 as presence true they return true, since zero is different then null or undefinedI have changed de value initial value from string and
Number
to be null as default, fromString
in specific to keep the coherence, but the comportment keeps the same as before.