Is there a "validates_empty" method or a way to do this in a single line?


#1

Hi,

re Model validations: is there a “validates_empty” method or a way to
do this in a single line?

tks


#2

Hmm… maybe validates_length_of with max set to 0 (and a custom
message)

Otherwise you may have to write your own validator using a callback
like before_create or before_validation_on_create.

– Mark.