demarches-normaliennes/app/models/champs/siret_champ.rb
2019-03-28 18:03:53 +01:00

9 lines
213 B
Ruby

class Champs::SiretChamp < Champ
def search_terms
etablissement.present? ? etablissement.search_terms : [value]
end
def mandatory_and_blank?
mandatory? && Siret.new(siret: value).invalid?
end
end