Skip to content
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

sumMin() behave same as sumMax() #8

Closed
dimuthun opened this issue Feb 22, 2012 · 1 comment
Closed

sumMin() behave same as sumMax() #8

dimuthun opened this issue Feb 22, 2012 · 1 comment

Comments

@dimuthun
Copy link

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
Copy link
Owner

Included in 1.3.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants