demarches-normaliennes/app/models/champs/siret_champ.rb

14 lines
291 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-04-03 16:29:42 +02:00
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
2018-04-03 16:29:42 +02:00
end