models: refactor the types_de_champ validators
Context: we want to validate public and private types_de_champ separately. Before we validated the whole revision (and then validators themselves enumerated all champs, public and private). Now we validate the actual public types_de_champ, which will let us validate separately the private types_de_champ.
This commit is contained in:
parent
64d75360d0
commit
e8e37cce15
8 changed files with 22 additions and 30 deletions
|
@ -53,7 +53,7 @@
|
|||
|
||||
- if !@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions)
|
||||
- @procedure.validate(:publication)
|
||||
- error_messages = @procedure.errors.messages_for(:draft_revision).to_sentence
|
||||
- error_messages = @procedure.errors.messages_for(:draft_types_de_champ).to_sentence
|
||||
|
||||
= link_to champs_admin_procedure_path(@procedure), class: 'card-admin', title: error_messages do
|
||||
- if @procedure.draft_types_de_champ.count == 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue