wip(validates): prefill and validate_champ_value? on all other missing validation checks

This commit is contained in:
mfo 2024-04-01 07:36:14 +02:00
parent 284a10e235
commit e08aa7d28b
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
16 changed files with 16 additions and 0 deletions

View file

@ -1,5 +1,6 @@
class Champs::DepartementChamp < Champs::TextChamp
store_accessor :value_json, :code_region
# TODO: if: -> { validate_champ_value? || validation_context == :prefill }
validate :value_in_departement_names, unless: -> { value.nil? }
validate :external_id_in_departement_codes, unless: -> { external_id.nil? }
before_save :store_code_region