This project is archived and is in readonly mode.

#6700 new
Erik Dungan

validates_numericality_of doesn't honor :allow_nil option (but does :allow_blank)

Reported by Erik Dungan | April 13th, 2011 @ 08:11 PM

In the documentation for the validates_numericality_of validation method, it lists a :allow_nil option. In my Rails 3.0.5 app my model will still not validate if this is set to true.

I tried it with :allow_blank => true and this seems to work. Perhaps the documentation should be updated to reflect this. (I can submit an update but I'm not sure how to do this)

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=""></a>

People watching this ticket