Merge pull request #815 from sgmap/fix-812
Force a single query for some includes
This commit is contained in:
commit
8125c7265a
1 changed files with 2 additions and 2 deletions
|
@ -287,11 +287,11 @@ module NewGestionnaire
|
||||||
@dossiers = @dossiers.includes({ user: :france_connect_information })
|
@dossiers = @dossiers.includes({ user: :france_connect_information })
|
||||||
when 'type_de_champ_group'
|
when 'type_de_champ_group'
|
||||||
if fields.any? { |field| field['table'] == 'type_de_champ' }
|
if fields.any? { |field| field['table'] == 'type_de_champ' }
|
||||||
@dossiers = @dossiers.includes(:champs)
|
@dossiers = @dossiers.includes(:champs).references(:champs)
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.any? { |field| field['table'] == 'type_de_champ_private' }
|
if fields.any? { |field| field['table'] == 'type_de_champ_private' }
|
||||||
@dossiers = @dossiers.includes(:champs_private)
|
@dossiers = @dossiers.includes(:champs_private).references(:champs_private)
|
||||||
end
|
end
|
||||||
|
|
||||||
where_conditions = fields.map do |field|
|
where_conditions = fields.map do |field|
|
||||||
|
|
Loading…
Reference in a new issue