demarches-normaliennes/app/models/champs/siret_champ.rb
2024-08-22 09:26:48 +02:00

13 lines
291 B
Ruby

# frozen_string_literal: true
class Champs::SiretChamp < Champ
include SiretChampEtablissementFetchableConcern
def search_terms
etablissement.present? ? etablissement.search_terms : [value]
end
def mandatory_blank?
mandatory? && Siret.new(siret: value).invalid?
end
end