Merge pull request #5652 from Keirua/fix/upload-repetition

Ensure a dossier_id is set for champs in Repetition
This commit is contained in:
Keirua 2020-09-30 17:02:02 +02:00 committed by GitHub
commit 1ba85e6080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,6 +61,7 @@ class Champ < ApplicationRecord
scope :root, -> { where(parent_id: nil) }
before_create :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] }