Apply suggestions from code review

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
This commit is contained in:
Paul Chavard 2021-05-25 11:14:02 +02:00
parent acb277e650
commit 179bb5a9fe
2 changed files with 7 additions and 7 deletions

View file

@ -197,12 +197,12 @@ module TagsSubstitutionConcern
end
def champ_public_tags(dossier: nil)
types_de_champ = (dossier ? dossier : procedure.active_revision).types_de_champ
types_de_champ = (dossier || procedure.active_revision).types_de_champ
types_de_champ_tags(types_de_champ, Dossier::SOUMIS)
end
def champ_private_tags(dossier: nil)
types_de_champ = (dossier ? dossier : procedure.active_revision).types_de_champ_private
types_de_champ = (dossier || procedure.active_revision).types_de_champ_private
types_de_champ_tags(types_de_champ, Dossier::INSTRUCTION_COMMENCEE)
end
@ -246,7 +246,7 @@ module TagsSubstitutionConcern
end
def replace_tag(text, tag, data)
libelle = Regexp.quote(tag[:id] ? tag[:id] : tag[:libelle])
libelle = Regexp.quote(tag[:id].presence || tag[:libelle])
# allow any kind of space (non-breaking or other) in the tags libellé to match any kind of space in the template
# (the '\\ |' is there because plain ASCII spaces were escaped by preceding Regexp.quote)