ensure a dossier_id is set if possible
This commit is contained in:
parent
5e081dd85b
commit
9019a8b380
1 changed files with 1 additions and 0 deletions
|
@ -61,6 +61,7 @@ class Champ < ApplicationRecord
|
||||||
|
|
||||||
scope :root, -> { where(parent_id: nil) }
|
scope :root, -> { where(parent_id: nil) }
|
||||||
|
|
||||||
|
before_create :set_dossier_id, if: :needs_dossier_id?
|
||||||
before_validation :set_dossier_id, if: :needs_dossier_id?
|
before_validation :set_dossier_id, if: :needs_dossier_id?
|
||||||
|
|
||||||
validates :type_de_champ_id, uniqueness: { scope: [:dossier_id, :row] }
|
validates :type_de_champ_id, uniqueness: { scope: [:dossier_id, :row] }
|
||||||
|
|
Loading…
Reference in a new issue