refactor: minor piece_justificative_multiple? question mark use

This commit is contained in:
Colin Darie 2022-11-08 12:33:01 +01:00
parent a726350f0d
commit 636645f686
2 changed files with 3 additions and 2 deletions

View file

@ -1,5 +1,6 @@
- user_can_destroy = !@champ.mandatory? || @champ.dossier.brouillon?
= render Attachment::MultipleComponent.new(form: @form, attached_file: @champ.piece_justificative_file, user_can_destroy: user_can_destroy, max: @champ.procedure&.piece_justificative_multiple == false ? 1 : nil) do |c|
- max = [true, nil].include?(@champ.procedure&.piece_justificative_multiple?) ? 10 : 1
= render Attachment::MultipleComponent.new(form: @form, attached_file: @champ.piece_justificative_file, user_can_destroy:, max:) do |c|
- if @champ.type_de_champ.piece_justificative_template&.attached?
- c.with_template do
%p

View file

@ -397,7 +397,7 @@ module Administrateurs
:tags
]
editable_params << :piece_justificative_multiple if @procedure&.piece_justificative_multiple == false
editable_params << :piece_justificative_multiple if @procedure && !@procedure.piece_justificative_multiple?
permited_params = if @procedure&.locked?
params.require(:procedure).permit(*editable_params)