allow_nil does not

Tom Davies
Tue, 13 Sep 2005 13:06:22 -0000

Hi,

I am having problems getting the allow_nil to allow nil.

I have a password field with the following validation:

  validates_length_of :password, :minimum => 6, :allow_nil => true

If I submit a form without entering the password, it comes in as
(printed via debug):

  password: ''''

The validation kicks in for the length and says it is too short.

Any ideas are appreciated.

Thanks,
Tom