Show more detailed error message for ident of "birthday" type

#569
This commit is contained in:
Artur Beljajev 2017-09-11 23:37:02 +03:00
parent 64439cfcef
commit 4d5830efdf
4 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
class Iso8601Validator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if options[:date_only]
record.errors.add(attribute, :invalid_iso8601) unless value =~ date_format
record.errors.add(attribute, :invalid_iso8601_date) unless value =~ date_format
end
end