No one was able to answer kris's question:

how to get validates_presence_of to work with non-null float/boolean/integer fields?

Has anyone figured out a way to get validates_presence_of to work with
float, boolean, and integer fields that are defined as non-null in the
schema?

The problem is, rails intializes these types to the default schema value,
which for mysql is never null if the column is not allowed to be null,
and as a result they are initialized in the form with a value, and are
never null.

I found a work around for integers that requires a nasty method override
in the ActiveRecord class that sets the default values from the
database, but I can not find a solution to do the same for floats
because ruby will not let me assign a float to null once it has been
initialized with a value.

People succeed in answering kris's questions 14% of the time (1 success in 7 attempts).

Answers by: Don Miguel de los Platanos | Rich Collins