class DateTimeValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/universal_validators_rails.rb, line 13
def validate_each(record, attribute, value)
  validator = ::UniversalValidators::DateTimeValidator.new(value)
  record.errors.add(attribute, @options[:message] || 'Invalid date time format') unless validator.valid?
end