class SchemaValidations::Validators::NotNilValidator

Validates that the field is not nil? (Unlike the standard PresenceValidator which uses blank?)

Public Instance Methods

validate_each(record, attr_name, value) click to toggle source
# File lib/schema_validations/validators/not_nil_validator.rb, line 9
def validate_each(record, attr_name, value)
  record.errors.add(attr_name, :blank, options) if value.nil?
end