Avoid useless TypeDeChamp deserialization
- 520 objects overs 4720 (10%) created in app/ (using ?pp=profile-memory&memory_profiler_allow_files=app/)
This commit is contained in:
parent
e728a3fcb7
commit
47f13219ed
1 changed files with 4 additions and 2 deletions
|
@ -65,12 +65,14 @@ class ProcedurePresentation < ApplicationRecord
|
|||
fields.concat procedure.types_de_champ
|
||||
.where.not(type_champ: explanatory_types_de_champ)
|
||||
.order(:id)
|
||||
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ', type_de_champ.stable_id.to_s) }
|
||||
.pluck(:libelle, :stable_id)
|
||||
.map { |(libelle, stable_id)| field_hash(libelle, 'type_de_champ', stable_id.to_s) }
|
||||
|
||||
fields.concat procedure.types_de_champ_private
|
||||
.where.not(type_champ: explanatory_types_de_champ)
|
||||
.order(:id)
|
||||
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ_private', type_de_champ.stable_id.to_s) }
|
||||
.pluck(:libelle, :stable_id)
|
||||
.map { |(libelle, stable_id)| field_hash(libelle, 'type_de_champ_private', stable_id.to_s) }
|
||||
|
||||
fields
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue