sumMin() behave same as sumMax()
Closed this issue · 1 comments
dimuthun commented
In the aggregate validator sumMin() implemented using 'less than' operator (<) where as it must be 'grater than' (>) operator. Therefore sumMin behave same as sumMax(). This defect was seen in Validity Version 1.2.0
Current Implementation
if ($reduction.length && min < numericSum($reduction)) {
raiseAggregateError(
$reduction,
msg || format(
$.validity.messages.sumMin,
{ min:min }
)
);
Corrected Implementation
if ($reduction.length && min > numericSum($reduction)) {
raiseAggregateError(
$reduction,
msg || format(
$.validity.messages.sumMin,
{ min:min }
)
);
whatgoodisaroad commented
Included in 1.3.0. Thanks!