forbid to create champ with same type_de_champ and same row
This commit is contained in:
parent
0538da3fad
commit
5b6044803b
2 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,8 @@ class Champ < ApplicationRecord
|
|||
|
||||
before_create :set_dossier_id, if: :needs_dossier_id?
|
||||
|
||||
validates :type_de_champ_id, uniqueness: { scope: [:dossier_id, :row] }
|
||||
|
||||
def public?
|
||||
!private?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue