Couldn’t have said it better myself.
Note that some of the validations (ie, validates_association) do
follow this behavior.
Shawn, could you post a link to the discussion you mentioned, as well as
to the announcement that this will be added?
Also, in the meanwhile, what is the preferred idiom for simulating this
(ie, validates_format_of when not nil)?
— List R. firstname.lastname@example.org wrote:
mandatory, you add a validates_presence_of. This
seems to me to be the
best design - why does validates_format_of break
I argued elsewhere that the only validation that
should fail on nil is the validates_presence_of. That
makes this concept orthogonal to all other
validations. Results in less code most of the time to.
The argument was not accepted, so we’ve branched our
rails tree, and it will have this behavior. I’ll be
posting a big patch somewhere soon.
It was mentioned that this will be changed in a post
Yahoo! DSL ï¿½ Something to write home about.
Just $16.99/mo. or less.