[#3477] The where clause doesn't do what it's supposed to do
This commit is contained in:
parent
cf3f2409dd
commit
4646e10864
1 changed files with 1 additions and 11 deletions
|
@ -154,17 +154,7 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
end
|
end
|
||||||
.uniq
|
.uniq
|
||||||
|
|
||||||
champ_fields = fields_to_eager_load.select do |field|
|
dossiers.includes(relations_to_include)
|
||||||
['type_de_champ', 'type_de_champ_private'].include?(field['table'])
|
|
||||||
end
|
|
||||||
|
|
||||||
if champ_fields.present?
|
|
||||||
dossiers
|
|
||||||
.includes(relations_to_include)
|
|
||||||
.where(champs: { type_de_champ_id: champ_fields.pluck('column') })
|
|
||||||
else
|
|
||||||
dossiers.includes(relations_to_include)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue