Sha256: 1c22008a790f0f2c019fd4ed1db192413463871918a4557e6298104023316910
Contents?: true
Size: 251 Bytes
Versions: 17
Compression:
Stored size: 251 Bytes
Contents
class DateFormatValidator < ActiveModel::EachValidator # :nodoc: def validate_each(record, attribute, value) begin Date.parse(value.to_s) rescue ArgumentError record.errors.add(attribute, 'is not a Date format') end end end
Version data entries
17 entries across 17 versions & 1 rubygems