mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 00:33:36 +02:00
parent
64439cfcef
commit
4d5830efdf
4 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue