Avoid n+1 when loading types de champ in to the editor
This commit is contained in:
parent
fbd10f7758
commit
2754dc9c9e
1 changed files with 4 additions and 1 deletions
|
@ -89,6 +89,9 @@ module ProcedureHelper
|
|||
.merge(include: TYPES_DE_CHAMP_INCLUDE.merge(types_de_champ: TYPES_DE_CHAMP_BASE))
|
||||
|
||||
def types_de_champ_as_json(types_de_champ)
|
||||
types_de_champ.as_json(TYPES_DE_CHAMP)
|
||||
types_de_champ.includes(:drop_down_list,
|
||||
piece_justificative_template_attachment: :blob,
|
||||
types_de_champ: [:drop_down_list, piece_justificative_template_attachment: :blob])
|
||||
.as_json(TYPES_DE_CHAMP)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue