Use query filter instead of array.reject
This commit is contained in:
parent
f5933ef2e5
commit
fed1f3e921
1 changed files with 2 additions and 2 deletions
|
@ -49,11 +49,11 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
explanatory_types_de_champ = [:header_section, :explication].map { |k| TypeDeChamp.type_champs.fetch(k) }
|
explanatory_types_de_champ = [:header_section, :explication].map { |k| TypeDeChamp.type_champs.fetch(k) }
|
||||||
|
|
||||||
fields.concat procedure.types_de_champ
|
fields.concat procedure.types_de_champ
|
||||||
.reject { |tdc| explanatory_types_de_champ.include?(tdc.type_champ) }
|
.where.not(type_champ: explanatory_types_de_champ)
|
||||||
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ', type_de_champ.id.to_s) }
|
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ', type_de_champ.id.to_s) }
|
||||||
|
|
||||||
fields.concat procedure.types_de_champ_private
|
fields.concat procedure.types_de_champ_private
|
||||||
.reject { |tdc| explanatory_types_de_champ.include?(tdc.type_champ) }
|
.where.not(type_champ: explanatory_types_de_champ)
|
||||||
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ_private', type_de_champ.id.to_s) }
|
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ_private', type_de_champ.id.to_s) }
|
||||||
|
|
||||||
fields
|
fields
|
||||||
|
|
Loading…
Reference in a new issue