I want to write an Active Record validation that throws an error when a user enters nothing at all in their form. Let's say the user has age and name properties, then it's fine if they don't enter age or don't enter name, but not entering both shouldn't happen. So I want something like this:
class User < ActiveRecord::Base
validate :not_all_empty
def not_all_empty
if name.blank? && age.blank?
errors.add (XXXX)
end
end
end