[#1110] Use tags method rather than ALLOWED_TAGS class constant

This commit is contained in:
Frederic Merizen 2017-12-22 21:33:04 +01:00
parent b9a1f707f5
commit e985439416
2 changed files with 5 additions and 1 deletions

View file

@ -34,6 +34,10 @@ module MailTemplateConcern
replace_tags(body, dossier)
end
def tags
self.class.const_get(:ALLOWED_TAGS)
end
def replace_tags(string, dossier)
TAGS.inject(string) do |acc, tag|
acc.gsub("--#{tag[:libelle]}--", replace_tag(tag, dossier)) || acc

View file

@ -22,7 +22,7 @@
Balise
%th
Description
- @mail_template.class.const_get(:ALLOWED_TAGS).each do |tag|
- @mail_template.tags.each do |tag|
%tr
%td.center
= "--#{tag[:libelle]}--"