This project is archived and is in readonly mode.

#4406 ✓resolved
Jsmith45

numericality validation gives misleading error message when only_integer is used

Reported by Jsmith45 | April 15th, 2010 @ 07:02 PM | in 3.0.2

If one uses the only_integer option of the numericality validator the result is an error message that may look like the following:
"2.5 is not a number". That is a very misleading error message. Unless I am mistaken, 2.5 is very much a number. Most of the other options for the numericality validator result in customized error messages by default. So while I could pass in a custom error message every time I use ':only_integer => true', that seems less than ideal.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages