fix(siret): don't add twice invalid format errors
This commit is contained in:
parent
64ce2719ed
commit
ad52710c3c
1 changed files with 1 additions and 3 deletions
|
@ -2,9 +2,7 @@ class SiretFormatValidator < ActiveModel::EachValidator
|
|||
def validate_each(record, attribute, value)
|
||||
if !format_is_valid(value)
|
||||
record.errors.add(attribute, :length)
|
||||
end
|
||||
|
||||
if !luhn_passed(value)
|
||||
elsif !luhn_passed(value)
|
||||
record.errors.add(attribute, :checksum)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue