fix(cojo): fetch external data when "-01" suffix is typed, even if its deleted later by .to_i
This commit is contained in:
parent
76a8e71fd5
commit
142ed6f762
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ class Champs::COJOChamp < Champ
|
|||
|
||||
def update_external_id
|
||||
if accreditation_number_changed? || accreditation_birthdate_changed?
|
||||
if accreditation_number.present? && accreditation_birthdate.present? && /\A\d+\z/.match?(accreditation_number)
|
||||
if accreditation_number.present? && accreditation_birthdate.present? && /\A[\d-]+\z/.match?(accreditation_number)
|
||||
self.external_id = { accreditation_number:, accreditation_birthdate: }.to_json
|
||||
else
|
||||
self.external_id = nil
|
||||
|
|
Loading…
Reference in a new issue