Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

equals validation problem with numbers #69

Closed
helnokaly opened this issue Sep 17, 2016 · 1 comment
Closed

equals validation problem with numbers #69

helnokaly opened this issue Sep 17, 2016 · 1 comment
Assignees

Comments

@helnokaly
Copy link
Contributor

helnokaly commented Sep 17, 2016

The equals validation fails with numbers because it compares Number with String (1 === '1')

data: {
  num: 1
}
rules: {
  num: 'integer|equals:1'
}
validation:  {
  "errors": [
    {
      "field": "num",
      "validation": "equals",
      "message": "equals validation failed on num"
    }
  ]
}
@thetutlage thetutlage self-assigned this Sep 23, 2016
@thetutlage
Copy link
Member

Sorry for the late reply have been busy lately. I will cast the value to a number before running the validation. Thanks for reporting.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants