class DateValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/validators/date_validator.rb, line 4
def validate_each(record, attribute, value)
  if Time.zone.parse(value.to_s).nil?
    record.errors.add attribute, I18n.t('date_validator.invalid_date')
    false
  end
end